diff --git a/projects/test_views.py b/projects/test_views.py index 99701bb..be311c9 100644 --- a/projects/test_views.py +++ b/projects/test_views.py @@ -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" """, @@ -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"))