Skip to content

Commit

Permalink
fix app label clash for invalid models test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptone committed Aug 28, 2012
1 parent c08d10d commit b126b52
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/modeltests/invalid_models/tests.py
Expand Up @@ -15,21 +15,19 @@ def setUp(self):
# Make sure sys.stdout is not a tty so that we get errors without
# coloring attached (makes matching the results easier). We restore
# sys.stderr afterwards.
cache.load_app("modeltests.invalid_models.invalid_models_app")
self.old_stdout = sys.stdout
self.stdout = StringIO()
sys.stdout = self.stdout
self.sync_receivers = post_syncdb.receivers
post_syncdb.receivers = []

def tearDown(self):
cache._reload()
sys.stdout = self.old_stdout
post_syncdb.receivers = self.sync_receivers

@override_settings(INSTALLED_APPS=("modeltests.invalid_models.invalid_models",))
def test_invalid_models(self):
cache._reload()
module = cache.get_app('invalid_models')
module = cache.get_app('invalid_models_app')
count = get_validation_errors(self.stdout, module)
self.stdout.seek(0)
error_log = self.stdout.read()
Expand Down

0 comments on commit b126b52

Please sign in to comment.