class TestRegister(TestCase, WagtailTestUtils): def setUp(self): self.registry = Registry() self.login() def test_register(self): self.assertNotIn(NotYetRegisteredSetting, self.registry) NowRegisteredSetting = self.registry.register_decorator(NotYetRegisteredSetting) self.assertIn(NotYetRegisteredSetting, self.registry) self.assertIs(NowRegisteredSetting, NotYetRegisteredSetting) def test_icon(self): admin = self.client.get(reverse('wagtailadmin_home')) self.assertContains(admin, 'icon icon-tag')
class GenericSettingRegisterTestCase(TestCase, WagtailTestUtils): def setUp(self): self.registry = Registry() self.login() def test_register(self): self.assertNotIn(NotYetRegisteredGenericSetting, self.registry) NowRegisteredGenericSetting = self.registry.register_decorator( NotYetRegisteredGenericSetting) self.assertIn(NotYetRegisteredGenericSetting, self.registry) self.assertIs(NowRegisteredGenericSetting, NotYetRegisteredGenericSetting) def test_icon(self): admin = self.client.get(reverse("wagtailadmin_home")) self.assertContains(admin, "icon-setting-tag")
def setUp(self): self.registry = Registry() self.login()