Mercurial > nosedjango
diff nosedjango/nosedjango.py @ 5:22ae9aa457af
excercise more bits of the django 1.0b1 test framework
author | Victor Ng <victor@monkeybean.ca> |
---|---|
date | Thu, 28 Aug 2008 11:29:21 -0400 |
parents | b761c26773a3 |
children | dfba3a3a4343 |
line wrap: on
line diff
--- a/nosedjango/nosedjango.py Thu Aug 28 10:18:23 2008 -0400 +++ b/nosedjango/nosedjango.py Thu Aug 28 11:29:21 2008 -0400 @@ -4,7 +4,6 @@ are run, and tears the test database (or schema) down after all tests are run. """ -import logging import os, sys import re @@ -16,18 +15,25 @@ # the settings file from nose.importer import add_path os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' +import re +NT_ROOT = re.compile(r"^[a-zA-Z]:\\$") def get_SETTINGS_PATH(): + ''' + Hunt down the settings.py module by going up the FS path + ''' cwd = os.getcwd() while cwd: if 'settings.py' in os.listdir(cwd): break cwd = os.path.split(cwd)[0] - if cwd == '/': + if os.name == 'nt' and NT_ROOT.match(cwd): + return None + elif cwd == '/': return None return cwd + SETTINGS_PATH = get_SETTINGS_PATH() -log = logging.getLogger('nose.plugins.nosedjango') class NoseDjango(Plugin): """