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."
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.')
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.')
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)
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])
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])