Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests module

git-svn-id: https://django-voting.googlecode.com/svn/trunk@47 662f01ad-f42a-0410-a340-718c64ddaef4
  • Loading branch information...
commit 4c9072c899547c3928132321c4af8d5d850f7935 1 parent 19fa7fd
Jonny Buchanan insin authored
0  tests/__init__.py
View
No changes.
10 tests/models.py
View
@@ -0,0 +1,10 @@
+from django.db import models
+
+class Item(models.Model):
+ name = models.CharField(maxlength=50)
+
+ def __str__(self):
+ return self.name
+
+ class Meta:
+ ordering = ['name']
11 tests/runtests.py
View
@@ -0,0 +1,11 @@
+import os, sys
+os.environ['DJANGO_SETTINGS_MODULE'] = 'voting.tests.settings'
+
+from django.test.simple import run_tests
+from django.conf import settings
+from django.db.models.loading import load_app
+
+test_models = [load_app(app) for app in settings.INSTALLED_APPS]
+failures = run_tests(test_models)
+if failures:
+ sys.exit(failures)
18 tests/settings.py
View
@@ -0,0 +1,18 @@
+import os
+DIRNAME = os.path.dirname(__file__)
+
+DEFAULT_CHARSET = 'utf-8'
+
+DATABASE_ENGINE = 'sqlite3'
+DATABASE_NAME = os.path.join(DIRNAME, 'database.db')
+DATABASE_USER = ''
+DATABASE_PASSWORD = ''
+DATABASE_HOST = ''
+DATABASE_PORT = ''
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'voting',
+ 'voting.tests',
+)
10 tests/tests.py
View
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+r"""
+>>> from voting.models import Vote
+
+##########
+# Voting #
+##########
+
+# Basic voting ###############################################################
+"""
Please sign in to comment.
Something went wrong with that request. Please try again.