Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#7 Added run_tests.py

no need for django-admin.py or maage.py

Running tests for django without using django-admin.py
Or using manage.py.
Bassically runnig just by executing this file.

Thanks to:
    - http://stackoverflow.com/q/3841725/636136
    - http://stackoverflow.com/a/3851333/636136
    - http://stackoverflow.com/a/12260597/636136
  • Loading branch information...
commit fad0114844e5287e8916f70c5acd30c2f7f01ae8 1 parent 9b39969
@Alir3z4 authored
Showing with 37 additions and 0 deletions.
  1. +37 −0 run_tests.py
View
37 run_tests.py
@@ -0,0 +1,37 @@
+"""
+Running tests for django without using django-admin.py
+Or using manage.py.
+Bassically runnig just by executing this file.
+
+Thanks to:
+ - http://stackoverflow.com/q/3841725/636136
+ - http://stackoverflow.com/a/3851333/636136
+ - http://stackoverflow.com/a/12260597/636136
+
+"""
+import os
+import sys
+from django.conf import settings
+
+DIR_NAME = os.path.dirname(__file__)
+settings.configure(
+ DEBUG=True,
+ DATABASES={
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ }
+ },
+ INSTALLED_APPS=(
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.admin',
+ 'django_markwhat'
+ )
+)
+
+from django.test.simple import DjangoTestSuiteRunner
+test_runner = DjangoTestSuiteRunner(verbosity=1)
+failures = test_runner.run_tests(['django_markwhat', ])
+if failures:
+ sys.exit(failures)
Please sign in to comment.
Something went wrong with that request. Please try again.