Beispiel #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())
Beispiel #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())
Beispiel #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()
     )
Beispiel #4
0
 def test_delete(self):
     addon = SourceEditAddon.create(self.subproject)
     response = self.client.post(
         addon.instance.get_absolute_url(),
         {'delete': '1'},
         follow=True,
     )
     self.assertContains(response, 'no addons currently installed')
Beispiel #5
0
 def test_delete(self):
     addon = SourceEditAddon.create(self.component)
     response = self.client.post(
         addon.instance.get_absolute_url(),
         {'delete': '1'},
         follow=True,
     )
     self.assertContains(response, 'no addons currently installed')
Beispiel #6
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())
Beispiel #7
0
 def test_delete(self):
     addon = SourceEditAddon.create(self.component)
     response = self.client.post(addon.instance.get_absolute_url(),
                                 {"delete": "1"},
                                 follow=True)
     self.assertContains(response, "no addons currently installed")