Author: kkubasik
Date: 2009-07-01 17:26:42 -0500 (Wed, 01 Jul 2009)
New Revision: 11143
Modified:
django/branches/soc2009/test-improvements/
django/branches/soc2009/test-improvements/django/db/models/loading.py
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
Log:
[gsoc2009-testing] Confirming that test-only models have a table in the db
Property changes on: django/branches/soc2009/test-improvements
___________________________________________________________________
Name: svk:merge
- 23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django-gsoc:10969
23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django/trunk:10927
bcc190cf-cafb-0310-a4f2-bffc1f526a37:/django/trunk:1054
+ 23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django-gsoc:10971
23ef3597-c209-482b-90c0-ea6045f15f7f:/local/django/trunk:10927
bcc190cf-cafb-0310-a4f2-bffc1f526a37:/django/trunk:1054
Modified: django/branches/soc2009/test-improvements/django/db/models/loading.py
===================================================================
--- django/branches/soc2009/test-improvements/django/db/models/loading.py
2009-07-01 14:24:25 UTC (rev 11142)
+++ django/branches/soc2009/test-improvements/django/db/models/loading.py
2009-07-01 22:26:42 UTC (rev 11143)
@@ -200,11 +200,12 @@
def remove_model(self, model_name):
"""Removes a model from the cache. Used when loading test-only
models."""
try:
- self.write_lock.acquire()
- if model_name in self.app_models:
- del self.app_models[model_name]
- except Exception, e:
- raise e
+ try:
+ self.write_lock.acquire()
+ if model_name in self.app_models:
+ del self.app_models[model_name]
+ except Exception, e:
+ raise e
finally:
self.write_lock.release()
Modified:
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
===================================================================
---
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
2009-07-01 14:24:25 UTC (rev 11142)
+++
django/branches/soc2009/test-improvements/tests/regressiontests/admin_views/tests.py
2009-07-01 22:26:42 UTC (rev 11143)
@@ -74,6 +74,14 @@
"Couldn't find an input with the right value in the response."
)
+ def testAddWithGETArgsTestModel(self):
+ response =
self.client.get('/test_admin/%s/admin_views/sectiontest/add/' % self.urlbit,
{'name': 'My TestSection'})
+ self.failUnlessEqual(response.status_code, 200)
+ self.failUnless(
+ 'value="My TestSection"' in response.content,
+ "Couldn't find an input with the right value in the response."
+ )
+
def testBasicEditGet(self):
"""
A smoke test to ensureGET on the change_view works.
@@ -300,6 +308,10 @@
"""
response = self.client.get('/test_admin/%s/admin_views/section/add/' %
self.urlbit)
self.failUnlessEqual(response.status_code, 200)
+ def testAddWithGETArgsTestModel(self):
+ response =
self.client.get('/test_admin/%s/admin_views/sectiontest/add/' % self.urlbit,
{'name': 'My TestSection'})
+ self.failUnlessEqual(response.status_code, 404)
+
def get_perm(Model, perm):
"""Return the permission object, for the Model"""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---