Add tests for wizard
This commit is contained in:
parent
7aa37b23e6
commit
e589e4f531
|
@ -29,8 +29,8 @@ try:
|
|||
pass
|
||||
|
||||
for config in BlogConfig.objects.all().order_by('namespace'):
|
||||
new_wizard = type(slugify(config.app_title), (PostWizard,), {})
|
||||
new_form = type('{0}Form'.format(slugify(config.app_title)), (PostWizardForm,), {
|
||||
new_wizard = type(str(slugify(config.app_title)), (PostWizard,), {})
|
||||
new_form = type(str('{0}Form').format(slugify(config.app_title)), (PostWizardForm,), {
|
||||
'default_appconfig': config.pk
|
||||
})
|
||||
post_wizard = new_wizard(
|
||||
|
|
|
@ -107,10 +107,10 @@ class BaseTest(BaseTestCase):
|
|||
name='main', width=200, height=200, crop=False, upscale=False
|
||||
)
|
||||
cls.app_config_1 = BlogConfig.objects.create(
|
||||
namespace='sample_app', app_title='app1'
|
||||
namespace='sample_app', app_title='app1', object_name='Blog'
|
||||
)
|
||||
cls.app_config_2 = BlogConfig.objects.create(
|
||||
namespace='sample_app2', app_title='app2'
|
||||
namespace='sample_app2', app_title='app2', object_name='Article'
|
||||
)
|
||||
cls.app_config_1.app_data.config.paginate_by = 1
|
||||
cls.app_config_1.save()
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import cms
|
||||
|
||||
from .base import BaseTest
|
||||
|
||||
try:
|
||||
from unittest import skipIf
|
||||
except ImportError:
|
||||
from unittest2 import skipIf
|
||||
|
||||
|
||||
class WizardTest(BaseTest):
|
||||
|
||||
@skipIf(LooseVersion(cms.__version__) < LooseVersion('3.2'),
|
||||
reason='Wizards not available for django CMS < 3.2')
|
||||
def test_wizard(self):
|
||||
"""
|
||||
Test that Blog wizard is present and contains all items
|
||||
"""
|
||||
from cms.wizards.wizard_pool import wizard_pool
|
||||
self.get_pages()
|
||||
wizard_pool._discover()
|
||||
|
||||
titles = [entry.title for entry in wizard_pool.get_entries()]
|
||||
self.assertTrue('New Blog' in titles)
|
||||
self.assertTrue('New Article' in titles)
|
1
tox.ini
1
tox.ini
|
@ -16,7 +16,6 @@ deps =
|
|||
cms30: https://github.com/divio/django-cms/archive/support/3.0.x.zip
|
||||
cms31: https://github.com/divio/django-cms/archive/support/3.1.x.zip
|
||||
cms32: https://github.com/divio/django-cms/archive/develop.zip
|
||||
cms32: django-cms>=3.2
|
||||
https://github.com/nephila/django-meta-mixin/archive/master.zip
|
||||
https://github.com/nephila/djangocms-helper/archive/develop.zip
|
||||
py26: unittest2
|
||||
|
|
Loading…
Reference in New Issue