Commit 772a9be2bac9c904100958f7251248d9be936e0e
1 parent
1fd2df78
Exists in
master
and in
79 other branches
Added tests and fixed urls.py
Showing
4 changed files
with
29 additions
and
8 deletions
Show diff stats
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +from django.http import HttpResponsePermanentRedirect | ||
2 | +from django.test import TestCase, Client | ||
3 | + | ||
4 | + | ||
5 | +class ColabSPB(TestCase): | ||
6 | + | ||
7 | + fixtures = ['colab_data.json'] | ||
8 | + | ||
9 | + def setUp(self): | ||
10 | + super(ColabSPB, self).setUp() | ||
11 | + self.client = Client() | ||
12 | + | ||
13 | + def tearDown(self): | ||
14 | + pass | ||
15 | + | ||
16 | + def test_getlist_without_list(self): | ||
17 | + response = self.client.get("/spb/get_list/?list_name=") | ||
18 | + self.assertEqual("x",response.content) | ||
19 | + | ||
20 | + def test_getlist_with_list(self): | ||
21 | + response = self.client.get("/spb/get_list/?list_name=ListA&MAX=5") | ||
22 | + self.assertEqual("x",response.content) | ||
23 | + | ||
24 | + def test_getlist_default_MAX(self): | ||
25 | + response = self.client.get("/spb/get_list/?list_name=ListA") | ||
26 | + self.assertEqual("x",response.content) | ||
27 | + |
colab_spb/urls.py