Пример #1
0
	def test_sync_new_user(self):

		syncer = UserSyncronizer()
		user = syncer.sync(self.data)

		new_user = User.objects.get(username="******")

		assert new_user.first_name == "Joe"
		assert new_user.last_name == "Soap"
		assert new_user.email == "*****@*****.**"
		assert new_user.is_staff == True
		assert new_user.is_superuser == True
Пример #2
0
	def test_sync_existing_user(self):

		data = {
			"id": 1, 
			"username": "******", 
			"first_name": "Peter",
			"last_name": "Pan",
			"is_staff": False,
			"is_superuser": False,
		}

		existing_user = User.objects.create(**data)

		syncer = UserSyncronizer()
		user = syncer.sync(self.data)

		assert user.first_name == "Joe"
		assert user.last_name == "Soap"
		assert user.email == "*****@*****.**"
		assert user.is_staff == True
		assert user.is_superuser == True