Merge pull request #116 from nephila/fix-testing

Fix testing
This commit is contained in:
Iacopo Spalletti 2015-06-15 17:39:27 +02:00
commit c661d652bf
4 changed files with 12 additions and 8 deletions

View file

@ -76,7 +76,6 @@ HELPER_SETTINGS = {
'django.contrib.messages.middleware.MessageMiddleware',
],
'MIGRATION_MODULES': {
'filer': 'filer.migrations_django',
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
},

View file

@ -18,6 +18,7 @@ from djangocms_blog.settings import get_setting
from . import BaseTest
from djangocms_helper.utils import CMS_30
class AdminTest(BaseTest):
@ -268,7 +269,10 @@ class ModelsTest(BaseTest):
tag = Tag.objects.create(name='tag 1')
plugin = add_plugin(post1.content, 'BlogLatestEntriesPlugin', language='en')
plugin.tags.add(tag)
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('tree_id', 'level', 'position'))
if CMS_30:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('tree_id', 'level', 'position'))
else:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('path', 'depth', 'position'))
copy_plugins_to(plugins, post2.content)
new = downcast_plugins(post2.content.cmsplugin_set.all())
self.assertEqual(set(new[0].tags.all()), set([tag]))
@ -297,7 +301,10 @@ class ModelsTest(BaseTest):
post2 = self._get_post(self.data['en'][1])
plugin = add_plugin(post1.content, 'BlogAuthorPostsPlugin', language='en')
plugin.authors.add(self.user)
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('tree_id', 'level', 'position'))
if CMS_30:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('tree_id', 'level', 'position'))
else:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by('path', 'depth', 'position'))
copy_plugins_to(plugins, post2.content)
new = downcast_plugins(post2.content.cmsplugin_set.all())
self.assertEqual(set(new[0].authors.all()), set([self.user]))

View file

@ -1,11 +1,12 @@
[tox]
envlist = py{26}-django{16},py{27,33,34}-django{16,17}
envlist = py{26}-django{16}-cms{30,31},py{27,33,34}-django{16,17}-cms{30,31}
[testenv]
deps =
django16: Django>=1.6,<1.7
django17: Django>=1.7,<1.8
django17: https://github.com/divio/django-cms/archive/support/3.0.x.zip
cms30: https://github.com/divio/django-cms/archive/support/3.0.x.zip
cms31: https://github.com/divio/django-cms/archive/develop.zip
py26: unittest2
py26: django-select2
py27: django-select2

View file

@ -1,3 +0,0 @@
#!/bin/sh
pip install 'setuptools<8.0' 'pip<6'
pip install $@