Fixed expressions unit test, DateTime refactored in Django 1.10

fix_request_path_info
Diederik van der Boor 2016-08-10 13:20:16 +02:00
parent 2e694fb2c6
commit dd89458615
1 changed files with 4 additions and 5 deletions

View File

@ -690,8 +690,8 @@ class PolymorphicTests(TestCase):
def test_instance_default_manager(self): def test_instance_default_manager(self):
def show_default_manager(instance): def show_default_manager(instance):
return "{0} {1}".format( return "{0} {1}".format(
repr(type(instance._default_manager)), repr(type(instance.__class__._default_manager)),
repr(instance._default_manager.model) repr(instance.__class__._default_manager.model)
) )
plain_a = PlainA(field1='C1') plain_a = PlainA(field1='C1')
@ -1172,11 +1172,10 @@ class PolymorphicTests(TestCase):
@skipIf(django.VERSION < (1,8,), "This test needs Django >=1.8") @skipIf(django.VERSION < (1,8,), "This test needs Django >=1.8")
def test_polymorphic__expressions(self): def test_polymorphic__expressions(self):
from django.db.models.expressions import DateTime from django.db.models.functions import Concat
from django.utils.timezone import utc
# no exception raised # no exception raised
result = DateModel.objects.annotate(val=DateTime('date', 'day', utc)) result = Model2B.objects.annotate(val=Concat('field1', 'field2'))
self.assertEqual(list(result), []) self.assertEqual(list(result), [])
class RegressionTests(TestCase): class RegressionTests(TestCase):