Skip to content
Browse files

Small doc and comment cleanups

  • Loading branch information...
1 parent ca3fdf1 commit 5c37c66cf7a134091f43164a2401d473b5e92ca0 @ericholscher committed Apr 12, 2009
View
3 docs/source/test_runner.rst
@@ -9,11 +9,10 @@ Introduction
------------
This script is fairly basic. Here is a quick example of how to use it::
- app_test_runner.py [path-to-app]
+ django_test_runner.py [path-to-app]
You must have Django on the PYTHONPATH prior to running this script. This
script basically will bootstrap a Django environment for you.
By default this script with use SQLite and an in-memory database. If you
are using Python 2.5 it will just work out of the box for you.
-
View
22 test_utils/bin/django_test_runner.py
@@ -3,35 +3,37 @@
Many thanks to Brian Rosner <oebfare.com> for letting me include
this code in Test Utils.
"""
-
+
import os
import sys
-
+
from optparse import OptionParser
-
+
from django.conf import settings
from django.core.management import call_command
-
+
def main():
"""
The entry point for the script. This script is fairly basic. Here is a
quick example of how to use it::
-app_test_runner.py [path-to-app]
+
+ django_test_runner.py [path-to-app]
+
You must have Django on the PYTHONPATH prior to running this script. This
script basically will bootstrap a Django environment for you.
+
By default this script with use SQLite and an in-memory database. If you
are using Python 2.5 it will just work out of the box for you.
-TODO: show more options here.
"""
parser = OptionParser()
parser.add_option("--DATABASE_ENGINE", dest="DATABASE_ENGINE", default="sqlite3")
parser.add_option("--DATABASE_NAME", dest="DATABASE_NAME", default="")
parser.add_option("--DATABASE_USER", dest="DATABASE_USER", default="")
parser.add_option("--DATABASE_PASSWORD", dest="DATABASE_PASSWORD", default="")
parser.add_option("--SITE_ID", dest="SITE_ID", type="int", default=1)
-
+
options, args = parser.parse_args()
-
+
# check for app in args
try:
app_path = args[0]
@@ -43,7 +45,7 @@ def main():
app_path = app_path[:-1]
parent_dir, app_name = os.path.split(app_path)
sys.path.insert(0, parent_dir)
-
+
settings.configure(**{
"DATABASE_ENGINE": options.DATABASE_ENGINE,
"DATABASE_NAME": options.DATABASE_NAME,
@@ -72,6 +74,6 @@ def main():
),
})
call_command("test")
-
+
if __name__ == "__main__":
main()
View
1 test_utils/models.py
@@ -0,0 +1 @@
+#This is here so that Django thinks we are a model so we can test it.
View
2 test_utils/templatetags/__init__.py
@@ -12,8 +12,6 @@
tag_re = re.compile('({% (.*?) %})')
-#output_ttag_tests(user_context, response.template[0])
-
### Template Tag Maker stuff
class TemplateParser(object):
View
1 test_utils/utils/twill_runner.py
@@ -18,6 +18,7 @@
Usage:
+ from test_utils.utils import twill_runner as twill
twill.setup()
try:
twill.go('/') # --> Django WSGI

0 comments on commit 5c37c66

Please sign in to comment.
Something went wrong with that request. Please try again.