30
src/django_deploy/tests/test_hooks.py
Normal file
30
src/django_deploy/tests/test_hooks.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
from django.conf.urls import url, include
|
||||
|
||||
from ..hooks import get_installed_apps, get_urlpatterns
|
||||
|
||||
|
||||
class HooksTestCase(unittest.TestCase):
|
||||
def test_get_installed_apps(self):
|
||||
test_data_sets = [
|
||||
(__file__, ['fake_app1', 'fake_app2']),
|
||||
]
|
||||
|
||||
for file_path, installed_apps in test_data_sets:
|
||||
result = get_installed_apps(file_path, installed_apps)
|
||||
self.assertEqual(installed_apps, result)
|
||||
|
||||
def test_get_urlpatterns(self):
|
||||
test_data_sets = [
|
||||
(
|
||||
__file__,
|
||||
[
|
||||
url('/app1', include('django_deploy.tests.fake_app1.urls')),
|
||||
url('/app2', include('django_deploy.tests.fake_app2.urls')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
for file_path, urlpatterns in test_data_sets:
|
||||
result = get_urlpatterns(file_path, urlpatterns)
|
||||
self.assertEqual(urlpatterns, result)
|
||||
Reference in New Issue
Block a user