Author: Alex
Date: 2009-06-18 19:29:18 -0500 (Thu, 18 Jun 2009)
New Revision: 11076

Modified:
   
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
Log:
[soc2009/multidb] Added tests to ensure that objects aren't being created 
before they are supposed to be, which would indicate we weren't creating 
objects in the right DB.

Modified: 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
===================================================================
--- 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
    2009-06-19 00:21:38 UTC (rev 11075)
+++ 
django/branches/soc2009/multidb/tests/regressiontests/multiple_database/tests.py
    2009-06-19 00:29:18 UTC (rev 11076)
@@ -28,6 +28,8 @@
 class QueryTestCase(TestCase):
     def test_basic_queries(self):
         for db in connections:
+            self.assertRaises(Book.DoesNotExist,
+                lambda: Book.objects.using(db).get(title="Dive into Python"))
             Book.objects.using(db).create(title="Dive into Python",
                 published=datetime.date(2009, 5, 4))
 
@@ -39,6 +41,8 @@
             self.assertEqual(books[0].published, datetime.date(2009, 5, 4))
 
         for db in connections:
+            self.assertRaises(Book.DoesNotExist,
+                lambda: Book.objects.using(db).get(title="Pro Django"))
             book = Book(title="Pro Django", published=datetime.date(2008, 12, 
16))
             book.save(using=db)
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to