Move testdummy plugin to the test directory

This commit is contained in:
Raphael Michel
2015-06-03 18:14:05 +02:00
parent fad8605aa7
commit 6c3df1e3f5
7 changed files with 12 additions and 8 deletions

View File

@@ -95,7 +95,6 @@ INSTALLED_APPS = (
'bootstrap3',
'debug_toolbar.apps.DebugToolbarConfig',
'djangoformsetjs',
'pretix.plugins.testdummy',
'pretix.plugins.timerestriction',
'pretix.plugins.banktransfer',
'pretix.plugins.stripe',

View File

@@ -49,9 +49,9 @@ class PluginSignalTest(TestCase):
self.assertEqual(len(responses), 0)
def test_one_plugin_active(self):
self.event.plugins = 'pretix.plugins.testdummy'
self.event.plugins = 'tests.testdummy'
self.event.save()
payload = {'foo': 'bar'}
responses = determine_availability.send(self.event, **payload)
self.assertEqual(len(responses), 1)
self.assertIn('pretix.plugins.testdummy.signals', [r[0].__module__ for r in responses])
self.assertIn('tests.testdummy.signals', [r[0].__module__ for r in responses])

View File

@@ -328,7 +328,7 @@ class CartTest(CartTestMixin, TestCase):
self.assertFalse(CartPosition.objects.current.filter(user=self.user, event=self.event).exists())
def test_restriction_failed(self):
self.event.plugins = 'pretix.plugins.testdummy'
self.event.plugins = 'tests.testdummy'
self.event.save()
self.event.settings.testdummy_available = 'yes'
response = self.client.post('/%s/%s/cart/add' % (self.orga.slug, self.event.slug), {
@@ -343,7 +343,7 @@ class CartTest(CartTestMixin, TestCase):
self.assertEqual(objs[0].price, 23)
def test_restriction_ok(self):
self.event.plugins = 'pretix.plugins.testdummy'
self.event.plugins = 'tests.testdummy'
self.event.save()
self.event.settings.testdummy_available = 'no'
response = self.client.post('/%s/%s/cart/add' % (self.orga.slug, self.event.slug), {

View File

@@ -3,3 +3,7 @@ from pretix.settings import *
TEST_DIR = os.path.dirname(__file__)
TEMPLATES[0]['DIRS'].append(os.path.join(TEST_DIR, 'templates'))
INSTALLED_APPS = INSTALLED_APPS + (
'tests.testdummy',
)

View File

@@ -3,7 +3,7 @@ from pretix.base.plugins import PluginType
class TestDummyApp(AppConfig):
name = 'pretix.plugins.testdummy'
name = 'tests.testdummy'
verbose_name = '.testdummy'
class PretixPluginMeta:
@@ -12,6 +12,7 @@ class TestDummyApp(AppConfig):
version = '1.0.0'
def ready(self):
from . import signals # NOQA
from tests.testdummy import signals
default_app_config = 'pretix.plugins.testdummy.TestDummyApp'
default_app_config = 'tests.testdummy.TestDummyApp'