Skip to content

Commit

Permalink
Adjusted HTML test assertions. (carltongibson#23)
Browse files Browse the repository at this point in the history
Addition on Tailwind classes in
b129095 broke assertions.

Fixes carltongibson#22.
  • Loading branch information
carltongibson authored Jun 20, 2023
1 parent d80a4c7 commit 01ed67e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ def test_list(self):
self.assertContains(response, self.homepage.title)
self.assertContains(response, self.github.title)
self.assertContains(response, self.fosstodon.title)
self.assertContains(
response, '<a href="/bookmark/new/">Add a new bookmark</a>', html=True
)
self.assertContains(response, ">Add a new bookmark</a>")

def test_list_empty(self):
Bookmark.objects.all().delete()
response = self.client.get("/bookmark/")
self.assertEqual(response.status_code, 200)
self.assertContains(response, "There are no bookmarks. Create one now?")
self.assertContains(
response, '<a href="/bookmark/new/">Add a new bookmark</a>', html=True
)
self.assertContains(response, ">Add a new bookmark</a>")

def test_detail(self):
response = self.client.get(f"/bookmark/{self.homepage.pk}/")
Expand All @@ -69,7 +65,7 @@ def test_create(self):
# Load the form.
response = self.client.get(create_url)
self.assertEqual(response.status_code, 200)
self.assertContains(response, '<form method="POST" action="/bookmark/new/">')
self.assertContains(response, 'action="/bookmark/new/"')

# Submit the form.
response = self.client.post(
Expand Down

0 comments on commit 01ed67e

Please sign in to comment.