Commit ae33d540bf167c309e25ce1a1db8547cf66e7122
1 parent
0df355e5
Exists in
master
and in
4 other branches
plugins: test dispatch without app_label
Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com> Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
Showing
2 changed files
with
22 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +from django.test import TestCase | ||
2 | +from django.test.client import RequestFactory | ||
3 | + | ||
4 | +from ..views import ColabProxyView | ||
5 | +from colab.accounts.models import User | ||
6 | + | ||
7 | + | ||
8 | +class ViewsTest(TestCase): | ||
9 | + | ||
10 | + def setUp(self): | ||
11 | + self.view = ColabProxyView() | ||
12 | + self.factory = RequestFactory() | ||
13 | + self.user = User.objects.create_user( | ||
14 | + username='john', email='john@test.org', password='123', | ||
15 | + first_name='John', last_name='John') | ||
16 | + | ||
17 | + def test_dispatch_without_app_label(self): | ||
18 | + request = self.factory.get('/') | ||
19 | + request.user = self.user | ||
20 | + | ||
21 | + with self.assertRaises(NotImplementedError): | ||
22 | + self.view.dispatch(request, '/') |