def test_retrive_users_empty_list(self, m): m.register_uri('POST', f'http://127.0.0.1:8000/api/authentication/users/', json=[], status_code=200) response = UserInteractor.retrive_users_list( queryset=User.objects.none()) self.assertEquals(len(response), 0)
def test_retrive_users_list(self, m): user = self.make_user(username=self.valid_data['username']) m.register_uri('POST', f'http://127.0.0.1:8000/api/authentication/users/', json=[{ 'uuid': str(user.uuid) }], status_code=200) response = UserInteractor.retrive_users_list( queryset=User.objects.all()) self.assertEquals(len(response), 1) self.assertEquals(response[0]['uuid'], str(user.uuid))