def test_example_3(self): q = Query() q.username = '******' q.password = hashlib.md5('password').hexdigest() q.profile.name = 'Sergey' q.profile.surname = 'Nikitin' q.profile.age = 28 q.profile.gender = 'M' q.profile.dob = datetime.datetime(1985, 10, 8).strftime('%Y-%m-%d') q.created = 1381733783 q.version += 1 self.assertDictEqual(q.update, {'$set': {'username': '******', 'profile.name': 'Sergey', 'created': 1381733783, 'profile.age': 28, 'profile.surname': 'Nikitin', 'profile.gender': 'M', 'profile.dob': '1985-10-08', 'password': '******'}, '$inc': {'version': 1}})