Skip to content

Commit

Permalink
Test modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 4, 2024
1 parent ecc50cb commit f7a2bfe
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions projects/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def test_smoke(self):

self.assertIn(
"""\
#: conf/strings.js frontend/intro/intro.js frontend/people/person.js
msgid "Continue"
msgstr "Blub"
""",
Expand All @@ -175,6 +176,51 @@ def test_smoke(self):
c.pofile,
)

# Modifications

r = su_client.post(
c.get_absolute_url() + "?query=continue",
{
"msgid_0": "Continue",
"msgstr_0": "Onward!", # Obviously incorrect.
"fuzzy_0": "on",
},
headers={"accept-language": "en"},
)
self.assertRedirects(r, c.get_absolute_url() + "?query=continue&start=0")

c.refresh_from_db()
self.assertIn(
"""\
#: conf/strings.js frontend/intro/intro.js frontend/people/person.js
#, fuzzy
msgid "Continue"
msgstr "Onward!"
""",
c.pofile,
)

r = su_client.post(
c.get_absolute_url() + "?query=continue",
{
"msgid_0": "Continue",
"msgstr_0": "Onward!", # Obviously incorrect.
"fuzzy_0": "",
},
headers={"accept-language": "en"},
)
self.assertRedirects(r, c.get_absolute_url() + "?query=continue&start=0")

c.refresh_from_db()
self.assertIn(
"""\
#: conf/strings.js frontend/intro/intro.js frontend/people/person.js
msgid "Continue"
msgstr "Onward!"
""",
c.pofile,
)

# print(c.pofile)
# print(list(c.po))
# print(r, r.content.decode("utf-8"))
Expand Down

0 comments on commit f7a2bfe

Please sign in to comment.