Commit ca5c0915 authored by Michal Čihař's avatar Michal Čihař

Add tests for directory listing

parent 8a784f36
......@@ -180,3 +180,31 @@ class DictionaryTest(ViewTestCase):
response,
u'msgid "wizard"\nmsgstr "průvodce"'
)
def test_list(self):
'''
Test for listing dictionaries.
'''
self.import_tbx()
# List dictionaries
response = self.client.get(reverse(
'show_dictionaries',
kwargs=self.kw_project
))
self.assertContains(response, 'Czech')
self.assertContains(response, 'Italian')
dict_url = self.get_url('show_dictionary')
# List all words
response = self.client.get(dict_url)
self.assertContains(response, 'Czech')
self.assertContains(response, '1 / 7')
self.assertContains(response, u'datový tok')
# Filtering by letter
response = self.client.get(dict_url, {'letter': 'b'})
self.assertContains(response, 'Czech')
self.assertContains(response, '1 / 1')
self.assertContains(response, u'datový tok')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment