diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index ded3e8f..e9ccf27 100644
a
|
b
|
import sys
|
7 | 7 | from django.conf import settings |
8 | 8 | from django.core.exceptions import FieldError |
9 | 9 | from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS |
10 | | from django.db.models import Count |
| 10 | from django.db.models import Count, F |
11 | 11 | from django.db.models.query import Q, ITER_CHUNK_SIZE, EmptyQuerySet |
12 | 12 | from django.test import TestCase, skipUnlessDBFeature |
13 | 13 | from django.utils import unittest |
… |
… |
class CloneTests(TestCase):
|
1610 | 1610 | except: |
1611 | 1611 | self.fail('Query should be clonable') |
1612 | 1612 | |
| 1613 | def test_clone_restricted(self): |
| 1614 | """ |
| 1615 | Test that cloning a queryset does not get out of hand. While complete |
| 1616 | testing is impossible, this is a sanity check against invalid use of |
| 1617 | deepcopy. refs #16759. |
| 1618 | """ |
| 1619 | qs = Note.objects.all().filter(pk__lte=F('pk') + 1) |
| 1620 | orig_opts = qs.query.where.children[0].children[0][3].opts |
| 1621 | # Lets clone it and see that the opts did not get cloned. |
| 1622 | qs = qs.all() |
| 1623 | new_opts = qs.query.where.children[0].children[0][3].opts |
| 1624 | self.assertTrue(orig_opts is new_opts) |
1613 | 1625 | |
1614 | 1626 | class EmptyQuerySetTests(TestCase): |
1615 | 1627 | def test_emptyqueryset_values(self): |