Fix issue #1286 and #844.: when building a query set from filters that reference the same field several times, do not assume each value is a dict

This commit is contained in:
Tal Yalon
2018-06-22 14:16:17 +03:00
parent 3cb6a5cfac
commit 080226dd72
2 changed files with 9 additions and 1 deletions

View File

@@ -1202,6 +1202,14 @@ class QuerySetTest(unittest.TestCase):
BlogPost.drop_collection()
Blog.drop_collection()
def test_filter_chaining_with_regex(self):
person = self.Person(name='Guido van Rossum')
person.save()
people = self.Person.objects
people = people.filter(name__startswith='Gui').filter(name__not__endswith='tum')
self.assertEqual(people.count(), 1)
def assertSequence(self, qs, expected):
qs = list(qs)
expected = list(expected)