Added a test for TranslatableFile.__eq__().

This commit is contained in:
Mads Jensen 2017-09-22 20:05:26 +02:00 committed by Tim Graham
parent 00709d704e
commit c0d968ea1f
1 changed files with 9 additions and 0 deletions

View File

@ -11,3 +11,12 @@ class TranslatableFileTests(SimpleTestCase):
file_name = 'example' file_name = 'example'
trans_file = TranslatableFile(dirpath=dirpath, file_name=file_name, locale_dir=None) trans_file = TranslatableFile(dirpath=dirpath, file_name=file_name, locale_dir=None)
self.assertEqual(repr(trans_file), '<TranslatableFile: %s>' % os.path.join(dirpath, file_name)) self.assertEqual(repr(trans_file), '<TranslatableFile: %s>' % os.path.join(dirpath, file_name))
def test_eq(self):
dirpath = 'dir'
file_name = 'example'
trans_file = TranslatableFile(dirpath=dirpath, file_name=file_name, locale_dir=None)
trans_file_eq = TranslatableFile(dirpath=dirpath, file_name=file_name, locale_dir=None)
trans_file_not_eq = TranslatableFile(dirpath='tmp', file_name=file_name, locale_dir=None)
self.assertEqual(trans_file, trans_file_eq)
self.assertNotEqual(trans_file, trans_file_not_eq)