Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dirty tests are better than no tests

  • Loading branch information...
commit 817170a876ede6c0fc5b84e3cf765b50eecd87bf 1 parent c0f2669
@jbalogh jbalogh authored
View
2  LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009, Jeff Balogh.
+Copyright (c) 2010, Jeff Balogh.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
View
29 runtests.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+export PYTHONPATH=.
+
+django_test() {
+ TEST="django-admin.py test --settings=testapp.$1"
+ $TEST 2>&1 | grep 'Ran 1 test' > /dev/null
+ if [ $? -gt 0 ]
+ then
+ echo FAIL: $2
+ $TEST
+ exit 1;
+ else
+ echo PASS: $2
+ fi
+
+ # Check that we're hijacking the help correctly.
+ $TEST --help 2>&1 | grep 'NOSE_DETAILED_ERRORS' > /dev/null
+ if [ $? -gt 0 ]
+ then
+ echo FAIL: $2 '(--help)'
+ exit 1;
+ else
+ echo PASS: $2 '(--help)'
+ fi
+}
+
+django_test 'settings' 'normal settings'
+django_test 'settings_with_south' 'with south in installed apps'
View
0  testapp/__init__.py
No changes.
View
12 testapp/settings.py
@@ -0,0 +1,12 @@
+DATABASES = {
+ 'default': {
+ 'NAME': 'django_master',
+ 'ENGINE': 'django.db.backends.sqlite3',
+ }
+}
+
+INSTALLED_APPS = (
+ 'django_nose',
+)
+
+TEST_RUNNER = 'django_nose.run_tests'
View
3  testapp/settings_with_south.py
@@ -0,0 +1,3 @@
+from settings import *
+
+INSTALLED_APPS = ('south',) + INSTALLED_APPS
View
7 testapp/test_for_nose.py
@@ -0,0 +1,7 @@
+"""
+Django's test runner won't find this, but nose will.
+"""
+
+
+def test_addition():
+ assert 1 + 1 == 2
Please sign in to comment.
Something went wrong with that request. Please try again.