From ae33d540bf167c309e25ce1a1db8547cf66e7122 Mon Sep 17 00:00:00 2001 From: Lucas Kanashiro Date: Mon, 16 Nov 2015 15:54:09 -0200 Subject: [PATCH] plugins: test dispatch without app_label --- colab/plugins/tests/__init__.py | 0 colab/plugins/tests/test_views.py | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) create mode 100644 colab/plugins/tests/__init__.py create mode 100644 colab/plugins/tests/test_views.py diff --git a/colab/plugins/tests/__init__.py b/colab/plugins/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/colab/plugins/tests/__init__.py diff --git a/colab/plugins/tests/test_views.py b/colab/plugins/tests/test_views.py new file mode 100644 index 0000000..2227044 --- /dev/null +++ b/colab/plugins/tests/test_views.py @@ -0,0 +1,22 @@ +from django.test import TestCase +from django.test.client import RequestFactory + +from ..views import ColabProxyView +from colab.accounts.models import User + + +class ViewsTest(TestCase): + + def setUp(self): + self.view = ColabProxyView() + self.factory = RequestFactory() + self.user = User.objects.create_user( + username='john', email='john@test.org', password='123', + first_name='John', last_name='John') + + def test_dispatch_without_app_label(self): + request = self.factory.get('/') + request.user = self.user + + with self.assertRaises(NotImplementedError): + self.view.dispatch(request, '/') -- libgit2 0.21.2