Commit 772a9be2bac9c904100958f7251248d9be936e0e

Authored by Macartur Sousa
1 parent 1fd2df78

Added tests and fixed urls.py

colab_spb/tests/__init__.py 0 → 100644
colab_spb/tests/test_get_list.py 0 → 100644
... ... @@ -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
1 1 from django.conf.urls import patterns, url
2   -
  2 +from . import views
3 3  
4 4 urlpatterns = patterns('',
  5 + url( r'^get_list/$',views.get_list, name='get_list'),
5 6 )
... ...
... ... @@ -1,7 +0,0 @@
1   -from django.conf.urls import patterns, url
2   -from . import views
3   -
4   -urlpatterns = patterns('',
5   - url( r'^get_list/$',views.get_list, name='get_list'),
6   -)
7   -