App Mixin tests

This commit is contained in:
Matthias 2021-10-05 00:27:08 +02:00
parent 2d5854e1e5
commit a42bf4983d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -4,7 +4,7 @@ from django.test import TestCase
from django.conf import settings from django.conf import settings
from django.conf.urls import url, include from django.conf.urls import url, include
from plugins.integration import IntegrationPluginBase, SettingsMixin, UrlsMixin, NavigationMixin from plugins.integration import IntegrationPluginBase, AppMixin, SettingsMixin, UrlsMixin, NavigationMixin
class BaseMixinDefinition: class BaseMixinDefinition:
@ -80,6 +80,16 @@ class UrlsMixinTest(BaseMixinDefinition, TestCase):
self.assertIsNone(self.mixin_nothing.urlpatterns) self.assertIsNone(self.mixin_nothing.urlpatterns)
class AppMixinTest(BaseMixinDefinition, TestCase):
MIXIN_HUMAN_NAME = 'App registration'
MIXIN_NAME = 'app'
MIXIN_ENABLE_CHECK = 'has_app'
def test_function(self):
# test that this plugin is in settings
self.assertIn('plugin.sample', settings.INSTALLED_APPS)
class NavigationMixinTest(BaseMixinDefinition, TestCase): class NavigationMixinTest(BaseMixinDefinition, TestCase):
MIXIN_HUMAN_NAME = 'Navigation Links' MIXIN_HUMAN_NAME = 'Navigation Links'
MIXIN_NAME = 'navigation' MIXIN_NAME = 'navigation'