diff --git a/django/db/models/query.py b/django/db/models/query.py
index e16fca1..edb0991 100644
a
|
b
|
class EmptyQuerySet(QuerySet):
|
1021 | 1021 | pass |
1022 | 1022 | |
1023 | 1023 | def _clone(self, klass=None, setup=False, **kwargs): |
1024 | | c = super(EmptyQuerySet, self)._clone(klass, **kwargs) |
| 1024 | c = super(EmptyQuerySet, self)._clone(klass, setup=setup, **kwargs) |
1025 | 1025 | c._result_cache = [] |
1026 | 1026 | return c |
1027 | 1027 | |
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index 03c28b0..75653fc 100644
a
|
b
|
from django.db import DatabaseError, connections, DEFAULT_DB_ALIAS
|
4 | 4 | from django.db.models import Count |
5 | 5 | from django.test import TestCase |
6 | 6 | |
7 | | from models import Tag, Annotation, DumbCategory, Note, ExtraInfo |
| 7 | from models import Tag, Annotation, DumbCategory, Note, ExtraInfo, Number |
8 | 8 | |
9 | 9 | class QuerysetOrderedTests(unittest.TestCase): |
10 | 10 | """ |
… |
… |
class CloneTests(TestCase):
|
81 | 81 | self.assertEquals(ExtraInfo.objects.filter(note__in=n_list)[0].info, 'good') |
82 | 82 | except: |
83 | 83 | self.fail('Query should be clonable') |
| 84 | |
| 85 | |
| 86 | class EmptyQuerySetTests(TestCase): |
| 87 | def test_emptyqueryset_values(self): |
| 88 | "#14366 -- calling .values() on an EmptyQuerySet and then cloning that should not cause an error" |
| 89 | self.assertEqual(list(Number.objects.none().values('num').order_by('num')), []) |