diff --git a/dz/tasklib/tests/unittests/test_bundle.py b/dz/tasklib/tests/unittests/test_bundle.py index c09fb7a..6433529 100644 --- a/dz/tasklib/tests/unittests/test_bundle.py +++ b/dz/tasklib/tests/unittests/test_bundle.py @@ -6,7 +6,7 @@ import logging from StringIO import StringIO -from mocker import ANY, MATCH +# from mocker import ANY, MATCH from boto.s3.connection import S3Connection from os import path @@ -174,19 +174,23 @@ def test_build_bundle(self): taskconfig.DZ_ADMIN_MEDIA["url_path"]) in lines) # ensure we've predefined and redefined our settings - MR_line = ("MEDIA_ROOT = os.environ['CONFIG_WRITABLE_ROOT'] " - "+ '/static'") + settings_override_line = "DATABASE_ENGINE = 'postgresql_psycopg2'" + import_line = "from mysite.settings import *" + + # check that things are in there before we try to check their + # ordering + self.assertTrue(settings_override_line in lines, lines) + self.assertTrue(import_line in lines, lines) try: - first_MR = lines.index(MR_line) - first_import = lines.index("from mysite.settings import *", - first_MR) - last_MR = lines.index(MR_line, first_import) + first_settings = lines.index(settings_override_line) + first_import = lines.index(import_line, first_settings) + last_settings = lines.index(settings_override_line, first_import) except ValueError: print "Couldn't find something I expected in dz_settings." raise - self.assertTrue(first_MR < first_import < last_MR) + self.assertTrue(first_settings < first_import < last_settings)