Update changelog and add another ut case
This commit is contained in:
parent
56d9f7a8af
commit
c6c68abfcc
@ -6,6 +6,7 @@ Development
|
||||
===========
|
||||
- (Fill this out as you fix issues and develop your features).
|
||||
- Fix .only() working improperly after using .count() of the same instance of QuerySet
|
||||
- POTENTIAL BREAKING CHANGE: All result fields are now passed, including internal fields (_cls, _id) when using `QuerySet.as_pymongo` #1976
|
||||
|
||||
=================
|
||||
Changes in 0.16.3
|
||||
|
@ -4709,19 +4709,22 @@ class QuerySetTest(unittest.TestCase):
|
||||
|
||||
serialized_user = User.objects.exclude(
|
||||
'password_salt', 'password_hash').as_pymongo()[0]
|
||||
self.assertEqual(set(['_id', 'email']), set(serialized_user.keys()))
|
||||
self.assertEqual({'_id', 'email'}, set(serialized_user.keys()))
|
||||
|
||||
serialized_user = User.objects.exclude(
|
||||
'id', 'password_salt', 'password_hash').to_json()
|
||||
self.assertEqual('[{"email": "ross@example.com"}]', serialized_user)
|
||||
|
||||
serialized_user = User.objects.only('email').as_pymongo()[0]
|
||||
self.assertEqual({'_id', 'email'}, set(serialized_user.keys()))
|
||||
|
||||
serialized_user = User.objects.exclude(
|
||||
'password_salt').only('email').as_pymongo()[0]
|
||||
self.assertEqual(set(['_id', 'email']), set(serialized_user.keys()))
|
||||
self.assertEqual({'_id', 'email'}, set(serialized_user.keys()))
|
||||
|
||||
serialized_user = User.objects.exclude(
|
||||
'password_salt', 'id').only('email').as_pymongo()[0]
|
||||
self.assertEqual(set(['email']), set(serialized_user.keys()))
|
||||
self.assertEqual({'email'}, set(serialized_user.keys()))
|
||||
|
||||
serialized_user = User.objects.exclude(
|
||||
'password_salt', 'id').only('email').to_json()
|
||||
|
Loading…
x
Reference in New Issue
Block a user