Adding < django 1.6 flags in code and test
parent
a16345874e
commit
d714040331
|
|
@ -100,7 +100,8 @@ def translate_polymorphic_filter_definitions_in_args(queryset_model, args, using
|
|||
|
||||
Returns: modified Q objects
|
||||
"""
|
||||
return [translate_polymorphic_Q_object(queryset_model, q.clone(), using=using) for q in args]
|
||||
q_objects = [q if django.VERSION < (1, 6) else q.clone() for q in args]
|
||||
return [translate_polymorphic_Q_object(queryset_model, q, using=using) for q in q_objects]
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -824,6 +824,7 @@ class PolymorphicTests(TestCase):
|
|||
self.assertEqual(repr(objects[0]), '<Model2B: id 2, field1 (CharField), field2 (CharField)>')
|
||||
self.assertEqual(repr(objects[1]), '<Model2C: id 3, field1 (CharField), field2 (CharField), field3 (CharField)>')
|
||||
|
||||
@skipIf(django.VERSION < (1, 6), "Django 1.4 and 1.5 don't support q.clone()")
|
||||
def test_query_filter_exclude_is_immutable(self):
|
||||
# given
|
||||
q_to_reuse = Q(Model2B___field2='something')
|
||||
|
|
|
|||
Loading…
Reference in New Issue