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

Test TS file editing (issue #424)

parent ba5875d7
......@@ -147,10 +147,10 @@ class RepoTestCase(TestCase):
'po-mono/en.po',
)
def create_ts(self):
def create_ts(self, suffix=''):
return self._create_subproject(
'ts',
'ts/*.ts',
'ts{0}/*.ts'.format(suffix),
)
def create_iphone(self):
......@@ -355,8 +355,8 @@ class SubProjectTest(RepoTestCase):
self.verify_subproject(project, 1, 'cs', 4)
def test_create_ts(self):
project = self.create_ts()
self.verify_subproject(project, 1, 'cs', 4, 'Hello, world!')
project = self.create_ts('-translated')
self.verify_subproject(project, 1, 'cs', 4)
unit = Unit.objects.get(source__startswith='Orangutan')
self.assertTrue(unit.is_plural())
......@@ -367,7 +367,7 @@ class SubProjectTest(RepoTestCase):
self.assertFalse(unit.is_plural())
self.assertTrue(unit.translated)
self.assertFalse(unit.fuzzy)
self.assertEqual(unit.target, 'Hello, world!')
self.assertEqual(unit.target, 'Hello, world!\n')
unit = Unit.objects.get(source__startswith='Thank ')
self.assertFalse(unit.is_plural())
......
......@@ -642,6 +642,11 @@ class EditLinkTest(EditTest):
return self.create_link()
class EditTSTest(EditTest):
def create_subproject(self):
return self.create_ts()
class SuggestionsTest(ViewTestCase):
def add_suggestion_1(self):
return self.edit_unit(
......
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