Skip to content

Commit 8ce80ba

Browse files
VirginiaDooleyVirginia Dooley
authored andcommitted
The 'text' argument to find()-type methods is deprecated
1 parent 48f5a7b commit 8ce80ba

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

ynr/apps/elections/tests/test_election_list_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_single_election_posts_page(self):
2121

2222
self.assertTrue(
2323
response.html.find(
24-
"a", text="Member of Parliament for Camberwell and Peckham"
24+
"a", string="Member of Parliament for Camberwell and Peckham"
2525
)
2626
)
2727

ynr/apps/elections/tests/test_elections_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def test_constituencies_page(self):
1212
# Just a smoke test to check that the page loads:
1313
response = self.app.get("/elections/parl.2015-05-07/")
1414
dulwich = response.html.find(
15-
"a", text=re.compile(r"Dulwich and West Norwood")
15+
"a", string=re.compile(r"Dulwich and West Norwood")
1616
)
1717
self.assertTrue(dulwich)

ynr/apps/elections/uk/tests/test_finders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def test_nonsense_postcode_searches_for_candidate(self, mock_requests):
192192
self.assertEqual(response.status_code, 200)
193193
self.assertIn("Search candidates", response)
194194
a = response.html.find(
195-
"a", text=re.compile('Add "foo bar" as a new candidate')
195+
"a", string=re.compile('Add "foo bar" as a new candidate')
196196
)
197197
self.assertEqual(
198198
a["href"], "/person/create/select_election?name=foo bar"
@@ -211,7 +211,7 @@ def test_nonascii_postcode(self, mock_requests):
211211
self.assertEqual(response.status_code, 200)
212212
self.assertIn("Search candidates", response)
213213
a = response.html.find(
214-
"a", text=re.compile('Add "SW1A 1ӔA" as a new candidate')
214+
"a", string=re.compile('Add "SW1A 1ӔA" as a new candidate')
215215
)
216216
self.assertEqual(
217217
a["href"], "/person/create/select_election?name=SW1A 1\u04d4A"

0 commit comments

Comments
 (0)