Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Avoided test failure on MySQL by skipping a failing test

MySQL generates an extra query in inheritance cases when doing an update.
This results in a test failure when checking for number of queries in
update_only_fields tests. Added a skip temporarily to avoid this test
failure. Refs #18304.
  • Loading branch information...
commit de79d23ce04193e0bc140991533359002f62ddf9 1 parent 365853d
Anssi Kääriäinen authored May 12, 2012
5  tests/modeltests/update_only_fields/tests.py
... ...
@@ -1,6 +1,6 @@
1 1
 from __future__ import absolute_import
2 2
 
3  
-from django.test import TestCase
  3
+from django.test import TestCase, skipUnlessDBFeature
4 4
 from django.db.models.signals import pre_save, post_save
5 5
 from .models import Person, Employee, ProxyEmployee, Profile, Account
6 6
 
@@ -123,6 +123,9 @@ def post_save_receiver(**kwargs):
123 123
         self.assertEqual(len(pre_save_data), 0)
124 124
         self.assertEqual(len(post_save_data), 0)
125 125
 
  126
+    # A bug in SQLUpdateCompiler prevents this test from succeeding on MySQL
  127
+    # Require update_can_self_select for this test for now. Refs #18304.
  128
+    @skipUnlessDBFeature('update_can_self_select')
126 129
     def test_num_queries_inheritance(self):
127 130
         s = Employee.objects.create(name='Sara', gender='F')
128 131
         s.employee_num = 1

0 notes on commit de79d23

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