Permalink
Browse files

Inheriting from a class that defines 'test_' methods makes the tests …

…from the superclass run twice. Fixed this.
  • Loading branch information...
1 parent a7af082 commit 98069956f9a55b59b9ee106545edf06acdac1f2a @kux committed Oct 3, 2012
Showing with 12 additions and 9 deletions.
  1. +12 −9 cms/tests/placeholder.py
View
@@ -396,14 +396,8 @@ def test_excercise_get_attached_fields_notplugins(self):
result = [f.name for f in list(ph._get_attached_fields())]
self.assertEqual(result, ['placeholder']) # Simple PH - still one placeholder field name
-class PlaceholderAdminTest(CMSTestCase):
- placeholderconf = {'test': {
- 'limits': {
- 'global': 2,
- 'TextPlugin': 1,
- }
- }
- }
+
+class PlaceholderAdminTestBase(CMSTestCase):
def get_placeholder(self):
return Placeholder.objects.create(slot='test')
@@ -414,6 +408,15 @@ def get_admin(self):
def get_post_request(self, data):
return self.get_request(post_data=data)
+
+class PlaceholderAdminTest(PlaceholderAdminTestBase):
+ placeholderconf = {'test': {
+ 'limits': {
+ 'global': 2,
+ 'TextPlugin': 1,
+ }
+ }
+ }
def test_global_limit(self):
placeholder = self.get_placeholder()
admin = self.get_admin()
@@ -489,7 +492,7 @@ def test_edit_plugin_and_cancel(self):
-class PlaceholderPluginPermissionTests(PlaceholderAdminTest):
+class PlaceholderPluginPermissionTests(PlaceholderAdminTestBase):
def _testuser(self):
u = User(username="test", is_staff = True, is_active = True, is_superuser = False)

0 comments on commit 9806995

Please sign in to comment.