Skip to content

Commit

Permalink
Test coverage improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 5, 2024
1 parent fe03d64 commit ba8d1ac
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions projects/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ def test_filtering(self):
'<input type="hidden" name="msgid_1" value="Copied code!" id="id_msgid_1">',
)

r = su_client.get(
c.get_absolute_url() + "?start=1", headers={"accept-language": "en"}
)
self.assertContains(r, "msgid_0")
self.assertContains(
r,
'<input type="hidden" name="msgid_0" value="Copied code!" id="id_msgid_0">',
)

r = su_client.get(
c.get_absolute_url() + "?pending=on", headers={"accept-language": "en"}
)
Expand Down Expand Up @@ -244,6 +253,20 @@ def test_updating(self):

p, c = self.create_project_and_catalog()

with override_settings(DEEPL_AUTH_KEY="hello"):
r = su_client.get(
c.get_absolute_url(),
headers={"accept-language": "en"},
)
self.assertContains(r, "data-suggest")

with override_settings(DEEPL_AUTH_KEY=""):
r = su_client.get(
c.get_absolute_url(),
headers={"accept-language": "en"},
)
self.assertNotContains(r, "data-suggest")

r = su_client.post(
c.get_absolute_url(),
{
Expand Down

0 comments on commit ba8d1ac

Please sign in to comment.