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())
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())
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() )
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')
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')
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())
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")