Skip to content

Commit

Permalink
Update tests with button count
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley authored and Virginia Dooley committed Jun 2, 2023
1 parent 142367d commit bcdb0d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ynr/apps/people/tests/test_person_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ def test_get_non_existent(self):
def test_shows_no_edit_buttons_if_user_not_authenticated(self):
response = self.app.get("/person/2009/tessa-jowell")
edit_buttons = response.html.find_all("a", attrs={"class": "button"})
self.assertEqual(len(edit_buttons), 2)
self.assertEqual(len(edit_buttons), 1)
self.assertEqual(edit_buttons[0].string, "Log in to edit")

def test_shows_edit_buttons_if_user_authenticated(self):
response = self.app.get("/person/2009/tessa-jowell", user=self.user)
edit_buttons = response.html.find_all("a", attrs={"class": "button"})
self.assertEqual(len(edit_buttons), 3)
self.assertEqual(len(edit_buttons), 2)

def test_links_to_person_edit_page(self):
response = self.app.get("/person/2009/tessa-jowell", user=self.user)
Expand Down

0 comments on commit bcdb0d0

Please sign in to comment.