Acceptance test for language selector

Tests language selection feature for student dashboard
This commit is contained in:
Julia Hansbrough
2014-02-06 16:38:16 +00:00
committed by thedeadparrot
parent a5207708f8
commit d867e87b72
8 changed files with 15 additions and 42 deletions

View File

@@ -61,7 +61,10 @@ class DashboardPage(PageObject):
else:
return None
def change_language(self):
def change_language(self, code):
"""
Change the language on the dashboard to the language corresponding with `code`.
"""
self.css_click(".edit-language")
self.select_option("language", "eo")
self.select_option("language", code)
self.css_click("#submit-lang")

View File

@@ -81,17 +81,17 @@ class LanguageTest(UniqueCourseTest):
"""
super(LanguageTest, self).setUp()
self.dashboard_page = DashboardPage(self.browser)
def test_change_lang(self):
AutoAuthPage(self.browser, course_id=self.course_id).visit()
self.dashboard_page.visit()
# Change language to Esperanto
self.dashboard_page.change_language()
self.fail()
# Change language to Dummy Esperanto
self.dashboard_page.change_language("eo")
self.dashboard_page.visit()
body = self.browser.body
matches = re.match(u'^FÏND ÇØÜRSÉS.+$', body)
self.assertTrue(matches is not None)
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
seektext = u"\xc7\xdcRR\xc9NT \xc7\xd8\xdcRS\xc9S"
self.browser.is_text_present(seektext)
self.assertTrue(self.browser.is_text_present(seektext))
class HighLevelTabTest(UniqueCourseTest):

View File

@@ -1 +1 @@
[{"pk": 1, "model": "dark_lang.darklangconfig", "fields": {"change_date": "2014-01-30T20:34:20Z", "changed_by": null, "enabled": true, "released_languages": "en,eo"}}]
[{"pk": 1, "model": "dark_lang.darklangconfig", "fields": {"change_date": "2100-01-30T20:34:20Z", "changed_by": null, "enabled": true, "released_languages": "en,eo"}}]