[pypy-svn] r55027 - pypy/django/tests

antocuni at codespeak.net antocuni at codespeak.net
Tue May 20 18:12:40 CEST 2008


Author: antocuni
Date: Tue May 20 18:12:39 2008
New Revision: 55027

Modified:
   pypy/django/tests/conftest.py
Log:
clean both the cache and the INSTALLED_APPS after having ran an invalid model test



Modified: pypy/django/tests/conftest.py
==============================================================================
--- pypy/django/tests/conftest.py	(original)
+++ pypy/django/tests/conftest.py	Tue May 20 18:12:39 2008
@@ -142,8 +142,11 @@
             run_testcase_method(testcase) 
         finally:
             from django.conf import settings
-            #print settings.INSTALLED_APPS
-            #settings.INSTALLED_APPS.remove(name) 
+            from django.db.models.loading import cache
+            if name in settings.INSTALLED_APPS:
+                settings.INSTALLED_APPS.remove(name)
+            if self.parent.name in cache.app_models:
+                del cache.app_models[self.parent.name]
         
 class DjangoUnitTest(py.test.collect.Item):
     def run(self):



More information about the Pypy-commit mailing list