From ec6c5255e6816689ea991fe5ab99712b24d4c326 Mon Sep 17 00:00:00 2001 From: James Murty Date: Thu, 24 Nov 2016 16:54:45 +1100 Subject: [PATCH] Yet more fixes to get unit tests to work with latest ICEkit --- icekit_events/templates/base.html | 8 -------- icekit_events/tests/settings.py | 24 +++++++++++++++++++++--- icekit_events/tests/templates/base.html | 10 ++++++++++ 3 files changed, 31 insertions(+), 11 deletions(-) delete mode 100644 icekit_events/templates/base.html create mode 100644 icekit_events/tests/templates/base.html diff --git a/icekit_events/templates/base.html b/icekit_events/templates/base.html deleted file mode 100644 index e21d2c1..0000000 --- a/icekit_events/templates/base.html +++ /dev/null @@ -1,8 +0,0 @@ -{# ONLY FOR RUNNING TESTS INDEPENDENTLY OF ICEKIT #} - - - - - {% block body %}{% endblock %} - - diff --git a/icekit_events/tests/settings.py b/icekit_events/tests/settings.py index 46df37f..51b852b 100644 --- a/icekit_events/tests/settings.py +++ b/icekit_events/tests/settings.py @@ -34,15 +34,19 @@ 'django_nose', 'fluent_pages', 'fluent_contents', - 'icekit', + 'icekit_events', 'icekit_events.event_types.simple', 'icekit_events.page_types.eventlistingfordate', 'icekit_events.tests', + + # ICEkit modules must be loaded *after* events to avoid import errors + 'icekit', + 'icekit.workflow', + 'icekit.publishing', 'icekit.plugins.image', # Apps required for publishing features - 'icekit.publishing', 'model_settings', 'polymorphic', 'compressor', @@ -69,4 +73,18 @@ DDF_FILL_NULLABLE_FIELDS = False FLUENT_PAGES_TEMPLATE_DIR = os.path.join(BASE_DIR, '..', 'templates') -TEMPLATE_CONTEXT_PROCESSORS = ['django.core.context_processors.request'] +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + 'DIRS': [ + os.path.join('icekit_events', 'tests', 'templates'), + os.path.join('icekit_events', 'templates'), + ], + 'OPTIONS': { + 'context_processors': [ + 'django.core.context_processors.request', + ], + }, + }, +] diff --git a/icekit_events/tests/templates/base.html b/icekit_events/tests/templates/base.html new file mode 100644 index 0000000..a8ced82 --- /dev/null +++ b/icekit_events/tests/templates/base.html @@ -0,0 +1,10 @@ +{# ONLY FOR RUNNING TESTS INDEPENDENTLY OF ICEKIT #} + + + + + {% block title %}{% endblock %} + {% block content %}{% endblock %} + {% block body_js %}{% endblock %} + +