Example #1
0
 def test_translation_sequence_increases(self):
     """Make sure translation sequence increases monotonically."""
     newtrans1 = Translation.new("abc", "en-us")
     newtrans1.save()
     newtrans2 = Translation.new("def", "de")
     newtrans2.save()
     assert newtrans2.pk > newtrans1.pk, "Translation sequence needs to keep increasing."
Example #2
0
 def test_translation_sequence_increases(self):
     """Make sure translation sequence increases monotonically."""
     newtrans1 = Translation.new('abc', 'en-us')
     newtrans1.save()
     newtrans2 = Translation.new('def', 'de')
     newtrans2.save()
     assert newtrans2.pk > newtrans1.pk, (
         'Translation sequence needs to keep increasing.')
Example #3
0
 def test_translation_sequence_increases(self):
     """Make sure translation sequence increases monotonically."""
     newtrans1 = Translation.new('abc', 'en-us')
     newtrans1.save()
     newtrans2 = Translation.new('def', 'de')
     newtrans2.save()
     assert newtrans2.pk > newtrans1.pk, (
         'Translation sequence needs to keep increasing.')
Example #4
0
 def test_empty_translations_seq(self):
     """Make sure we can handle an empty translation sequence table."""
     TranslationSequence.objects.all().delete()
     newtrans = Translation.new('abc', 'en-us')
     newtrans.save()
     assert newtrans.id > 0, (
         'Empty translation table should still generate an ID.')
Example #5
0
 def test_empty_translations_seq(self):
     """Make sure we can handle an empty translation sequence table."""
     TranslationSequence.objects.all().delete()
     newtrans = Translation.new('abc', 'en-us')
     newtrans.save()
     assert newtrans.id > 0, (
         'Empty translation table should still generate an ID.')
Example #6
0
 def test_single_translation_sequence(self):
     """Make sure we only ever have one translation sequence."""
     TranslationSequence.objects.all().delete()
     eq_(TranslationSequence.objects.count(), 0)
     for i in range(5):
         newtrans = Translation.new(str(i), 'en-us')
         newtrans.save()
         eq_(TranslationSequence.objects.count(), 1)
Example #7
0
 def test_single_translation_sequence(self):
     """Make sure we only ever have one translation sequence."""
     TranslationSequence.objects.all().delete()
     eq_(TranslationSequence.objects.count(), 0)
     for i in range(5):
         newtrans = Translation.new(str(i), 'en-us')
         newtrans.save()
         eq_(TranslationSequence.objects.count(), 1)
Example #8
0
 def test_sorting(self):
     """Test translation comparisons in Python code."""
     b = Translation.new('bbbb', 'de')
     a = Translation.new('aaaa', 'de')
     c = Translation.new('cccc', 'de')
     eq_(sorted([c, a, b]), [a, b, c])
Example #9
0
 def test_sorting(self):
     """Test translation comparisons in Python code."""
     b = Translation.new('bbbb', 'de')
     a = Translation.new('aaaa', 'de')
     c = Translation.new('cccc', 'de')
     eq_(sorted([c, a, b]), [a, b, c])
Example #10
0
 def test_sorting(self):
     """Test translation comparisons in Python code."""
     b = Translation.new("bbbb", "de")
     a = Translation.new("aaaa", "de")
     c = Translation.new("cccc", "de")
     eq_(sorted([c, a, b]), [a, b, c])