Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8668: prevent MySQL from running the new test from [8676].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ddf7d7ab0257c6a6dc9ea141cba4b437431a85d1 1 parent 8cfecbd
Jacob Kaplan-Moss authored August 29, 2008
15  tests/regressiontests/serializers_regress/tests.py
@@ -260,11 +260,7 @@ def inherited_compare(testcase, pk, klass, data):
260 260
     (fk_obj, 452, FKDataToField, None),
261 261
 
262 262
     (fk_obj, 460, FKDataToO2O, 300),
263  
-    
264  
-    # Regression test for #8651 -- FK = 0
265  
-    (data_obj, 0, Anchor, "Anchor 0"),
266  
-    (fk_obj, 465, FKData, 0),
267  
-    
  263
+        
268 264
     (im2m_obj, 470, M2MIntermediateData, None),
269 265
     
270 266
     #testing post- and prereferences and extra fields
@@ -336,6 +332,15 @@ def inherited_compare(testcase, pk, klass, data):
336 332
                          data[2]._meta.get_field('data').empty_strings_allowed and
337 333
                          data[3] is None)]
338 334
 
  335
+# Regression test for #8651 -- a FK to an object iwth PK of 0
  336
+# This won't work on MySQL since it won't let you create an object
  337
+# with a primary key of 0,
  338
+if settings.DATABASE_ENGINE != 'mysql':
  339
+    test_data.extend([
  340
+        (data_obj, 0, Anchor, "Anchor 0"),
  341
+        (fk_obj, 465, FKData, 0),
  342
+    ])
  343
+
339 344
 # Dynamically create serializer tests to ensure that all
340 345
 # registered serializers are automatically tested.
341 346
 class SerializerTests(unittest.TestCase):

0 notes on commit ddf7d7a

Please sign in to comment.
Something went wrong with that request. Please try again.