Kaydet (Commit) ca43ee9d authored tarafından Tim Graham's avatar Tim Graham

Refs #17917 -- Added a test for pickling annotations on fields with callable defaults.

Fixed in f403653c.
üst 9a6fc960
......@@ -5,6 +5,7 @@ import pickle
import unittest
import warnings
from django.db import models
from django.test import TestCase
from django.utils import six
from django.utils.encoding import force_text
......@@ -130,6 +131,11 @@ class PickleabilityTestCase(TestCase):
m2ms = pickle.loads(pickle.dumps(m2ms))
self.assertQuerysetEqual(m2ms, [m2m], lambda x: x)
def test_annotation_with_callable_default(self):
# Happening.when has a callable default of datetime.datetime.now.
qs = Happening.objects.annotate(latest_time=models.Max('when'))
self.assert_pickles(qs)
def test_missing_django_version_unpickling(self):
"""
#21430 -- Verifies a warning is raised for querysets that are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment