def test_unit(self):
     self.assertTrue(SourceEditAddon.can_install(self.component, None))
     self.assertTrue(TargetEditAddon.can_install(self.component, None))
     self.assertTrue(SameEditAddon.can_install(self.component, None))
     SourceEditAddon.create(self.component)
     TargetEditAddon.create(self.component)
     SameEditAddon.create(self.component)
     Unit.objects.all().delete()
     self.component.create_translations(force=True)
     self.assertFalse(
         Unit.objects.exclude(state__in=(STATE_FUZZY,
                                         STATE_EMPTY)).exists())
Exemple #2
0
 def test_unit(self):
     self.assertTrue(SourceEditAddon.can_install(self.component, None))
     self.assertTrue(TargetEditAddon.can_install(self.component, None))
     self.assertTrue(SameEditAddon.can_install(self.component, None))
     SourceEditAddon.create(self.component)
     TargetEditAddon.create(self.component)
     SameEditAddon.create(self.component)
     Unit.objects.all().delete()
     self.component.create_translations(force=True)
     self.assertFalse(
         Unit.objects.exclude(
             state__in=(STATE_FUZZY, STATE_EMPTY)
         ).exists()
     )
Exemple #3
0
    def test_unit_flags(self):
        self.assertTrue(SourceEditAddon.can_install(self.component, None))
        self.assertTrue(TargetEditAddon.can_install(self.component, None))
        self.assertTrue(SameEditAddon.can_install(self.component, None))
        SourceEditAddon.create(self.component)
        TargetEditAddon.create(self.component)
        SameEditAddon.create(self.component)

        Unit.objects.filter(translation__language__code="cs").delete()
        self.component.create_translations(force=True)
        self.assertFalse(
            Unit.objects.filter(translation__language__code="cs").exclude(
                state__in=(STATE_FUZZY, STATE_EMPTY)).exists())

        Unit.objects.all().delete()
        self.component.create_translations(force=True)
        self.assertFalse(
            Unit.objects.exclude(state__in=(STATE_FUZZY, STATE_EMPTY,
                                            STATE_READONLY)).exists())