From 3b2e5673878e683503b531d0baf4ef80c1d66879 Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Tue, 23 May 2017 12:31:14 +0200 Subject: [PATCH] Increased tests coverage --- tests/tests.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/tests.py b/tests/tests.py index 11e538f..b0caeb0 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -58,6 +58,16 @@ class AdminInterfaceTestCase(TestCase): Theme.objects.all().update( active = False ) self.__test_active_theme() + def test_default_theme_activated_after_update_if_multiple_active_themes(self): + + Theme.objects.all().delete() + theme_1 = Theme.objects.create( name = 'Custom 1', active = True ) + theme_2 = Theme.objects.create( name = 'Custom 2', active = True ) + theme_3 = Theme.objects.create( name = 'Custom 3', active = True ) + Theme.objects.update( active = False ) + Theme.objects.update( active = True ) + self.__test_active_theme() + def test_default_theme_activated_on_active_theme_deleted(self): Theme.objects.all().delete() @@ -65,7 +75,7 @@ class AdminInterfaceTestCase(TestCase): theme_2 = Theme.objects.create( name = 'Custom 2', active = True ) theme_3 = Theme.objects.create( name = 'Custom 3', active = True ) Theme.objects.filter( pk = Theme.get_active_theme().pk ).delete() - self.assertEqual( Theme.get_active_theme().pk, 1 ) + self.__test_active_theme() def test_default_theme_logo_created_if_deleted(self):