Exemplo n.º 1
0
 def test_unit(self):
     self.assertTrue(SourceEditAddon.is_compatible(self.subproject))
     self.assertTrue(TargetEditAddon.is_compatible(self.subproject))
     SourceEditAddon.create(self.subproject)
     TargetEditAddon.create(self.subproject)
     Unit.objects.all().delete()
     self.subproject.create_translations(force=True)
     self.assertFalse(
         Unit.objects.exclude(state__in=(STATE_FUZZY,
                                         STATE_EMPTY)).exists())
Exemplo n.º 2
0
 def test_unit(self):
     self.assertTrue(SourceEditAddon.can_install(self.component, None))
     self.assertTrue(TargetEditAddon.can_install(self.component, None))
     SourceEditAddon.create(self.component)
     TargetEditAddon.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())
Exemplo n.º 3
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()
     )
Exemplo n.º 4
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())