Fixed theme switching bug
This commit is contained in:
@@ -5,6 +5,7 @@ from django.test import TestCase
|
||||
from django.template import Context, Template
|
||||
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
|
||||
from admin_interface.models import Theme
|
||||
@@ -93,6 +94,22 @@ class AdminInterfaceTestCase(TestCase):
|
||||
self.assertEqual( Theme.get_active_theme().pk, theme_3.pk )
|
||||
self.__test_active_theme()
|
||||
|
||||
def test_last_theme_activated_on_multiple_themes_activated(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_4 = Theme.objects.create( name = 'Custom 4', active = True )
|
||||
theme_5 = Theme.objects.create( name = 'Custom 5', active = True )
|
||||
themes = [ theme_1, theme_2, theme_3, theme_4, theme_5 ]
|
||||
for i in range(5):
|
||||
random.shuffle(themes)
|
||||
for theme in themes:
|
||||
theme.set_active()
|
||||
self.assertEqual( Theme.get_active_theme().pk, theme.pk )
|
||||
self.__test_active_theme()
|
||||
|
||||
def test_templatetags(self):
|
||||
|
||||
Theme.objects.all().delete()
|
||||
|
||||
Reference in New Issue
Block a user