some refactoring, added Package manager for removing code duplicates, added helpers module, basic tests layout

This commit is contained in:
volpino
2012-05-01 16:56:09 +02:00
parent 1c53c60eed
commit 8e37f6249c
34 changed files with 260 additions and 84 deletions

View File

View File

@ -132,15 +132,15 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
CACHE_MIDDLEWARE_SECONDS=3600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True
CACHE_MIDDLEWARE_SECONDS = 3600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
ROOT_URLCONF = 'euscanwww.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'euscanwww.wsgi.application'
FORCE_SCRIPT_NAME=""
FORCE_SCRIPT_NAME = ""
TEMPLATE_DIRS = (
os.path.join(SITE_ROOT, 'templates'),
@ -166,6 +166,7 @@ INSTALLED_APPS = (
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'south',
'euscanwww',
'djeuscan',
)

View File

@ -0,0 +1,45 @@
"""
System tests for euscanwww
"""
from urllib import urlencode
from django.utils import unittest
from django.test.client import Client
from django.core.urlresolvers import reverse
class SystemTestCase(unittest.TestCase):
"""
Base class for system tests
"""
def setUp(self):
self.client = Client()
def get(self, url_name, *args, **kwargs):
param = kwargs.pop("param", None)
if param:
url = "%s?%s" % (reverse(url_name, args=args, kwargs=kwargs),
urlencode(param))
else:
url = reverse(url_name, args=args, kwargs=kwargs)
return self.client.get(url)
def post(self, url_name, *args, **kwargs):
data = kwargs.pop("data", {})
url = reverse(url_name, args=args, kwargs=kwargs)
return self.client.post(url, data)
class NavigationTest(SystemTestCase):
"""
Test main pages
"""
def test_index(self):
"""
Test index
"""
response = self.get("index")
self.assertEqual(response.status_code, 200)