Fixed test failures introduced by #12288

This commit is contained in:
Tim Graham 2013-08-09 08:34:37 -04:00
parent 2ac89012d8
commit b575d690bb
1 changed files with 16 additions and 20 deletions

View File

@ -198,26 +198,22 @@ class JavascriptI18nTests(LiveServerTestCase):
@override_settings(LANGUAGE_CODE='de') @override_settings(LANGUAGE_CODE='de')
def test_javascript_gettext(self): def test_javascript_gettext(self):
extended_apps = list(settings.INSTALLED_APPS) + ['view_tests'] self.selenium.get('%s%s' % (self.live_server_url, '/jsi18n_template/'))
with self.settings(INSTALLED_APPS=extended_apps):
self.selenium.get('%s%s' % (self.live_server_url, '/jsi18n_template/'))
elem = self.selenium.find_element_by_id("gettext") elem = self.selenium.find_element_by_id("gettext")
self.assertEqual(elem.text, "Entfernen") self.assertEqual(elem.text, "Entfernen")
elem = self.selenium.find_element_by_id("ngettext_sing") elem = self.selenium.find_element_by_id("ngettext_sing")
self.assertEqual(elem.text, "1 Element") self.assertEqual(elem.text, "1 Element")
elem = self.selenium.find_element_by_id("ngettext_plur") elem = self.selenium.find_element_by_id("ngettext_plur")
self.assertEqual(elem.text, "455 Elemente") self.assertEqual(elem.text, "455 Elemente")
elem = self.selenium.find_element_by_id("pgettext") elem = self.selenium.find_element_by_id("pgettext")
self.assertEqual(elem.text, "Kann") self.assertEqual(elem.text, "Kann")
elem = self.selenium.find_element_by_id("npgettext_sing") elem = self.selenium.find_element_by_id("npgettext_sing")
self.assertEqual(elem.text, "1 Resultat") self.assertEqual(elem.text, "1 Resultat")
elem = self.selenium.find_element_by_id("npgettext_plur") elem = self.selenium.find_element_by_id("npgettext_plur")
self.assertEqual(elem.text, "455 Resultate") self.assertEqual(elem.text, "455 Resultate")
def test_escaping(self): def test_escaping(self):
extended_apps = list(settings.INSTALLED_APPS) + ['view_tests'] # Force a language via GET otherwise the gettext functions are a noop!
with self.settings(INSTALLED_APPS=extended_apps): response = self.client.get('/jsi18n_admin/?language=de')
# Force a language via GET otherwise the gettext functions are a noop! self.assertContains(response, '\\x04')
response = self.client.get('/jsi18n_admin/?language=de')
self.assertContains(response, '\\x04')