diff --git a/colab_spb/tests/__init__.py b/colab_spb/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/colab_spb/tests/__init__.py diff --git a/colab_spb/tests/test_get_list.py b/colab_spb/tests/test_get_list.py new file mode 100644 index 0000000..728f7dc --- /dev/null +++ b/colab_spb/tests/test_get_list.py @@ -0,0 +1,27 @@ +from django.http import HttpResponsePermanentRedirect +from django.test import TestCase, Client + + +class ColabSPB(TestCase): + + fixtures = ['colab_data.json'] + + def setUp(self): + super(ColabSPB, self).setUp() + self.client = Client() + + def tearDown(self): + pass + + def test_getlist_without_list(self): + response = self.client.get("/spb/get_list/?list_name=") + self.assertEqual("x",response.content) + + def test_getlist_with_list(self): + response = self.client.get("/spb/get_list/?list_name=ListA&MAX=5") + self.assertEqual("x",response.content) + + def test_getlist_default_MAX(self): + response = self.client.get("/spb/get_list/?list_name=ListA") + self.assertEqual("x",response.content) + diff --git a/colab_spb/urls.py b/colab_spb/urls.py index 1225304..cedca08 100644 --- a/colab_spb/urls.py +++ b/colab_spb/urls.py @@ -1,5 +1,6 @@ from django.conf.urls import patterns, url - +from . import views urlpatterns = patterns('', + url( r'^get_list/$',views.get_list, name='get_list'), ) diff --git a/urls.py b/urls.py deleted file mode 100644 index 0e0db96..0000000 --- a/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.conf.urls import patterns, url -from . import views - -urlpatterns = patterns('', - url( r'^get_list/$',views.get_list, name='get_list'), -) - -- libgit2 0.21.2