def test_user_addition(self): db_users.create( display_name='Tester 1', email='*****@*****.**', ) resp = self.client.get('/user/').json self.assertEqual(resp['count'], 1) self.assertEqual(len(resp['users']), 1)
def test_create(self): user = db_users.create(display_name="test_user", email="*****@*****.**", musicbrainz_username="******") self.assertEqual(user['email'], "*****@*****.**") self.assertEqual(type(user['id']), UUID) self.assertEqual(user['is_blocked'], False)
def test_user_entity_handler(self): user = User(db_users.create( display_name='Tester 1', email='*****@*****.**', )) resp = self.client.get('/user/{user_id}'.format(user_id=user.id)).json self.assertEqual(resp['user']['display_name'], 'Tester 1') # Test if user with specified ID does not exist self.assert404(self.client.get('/user/e7aad618-fd86-3983-9e77-405e21796eca'))
def test_user_entity_handler(self): user = User( db_users.create( display_name='Tester 1', email='*****@*****.**', )) resp = self.client.get('/user/{user_id}'.format(user_id=user.id)).json self.assertEqual(resp['user']['display_name'], 'Tester 1') # Test if user with specified ID does not exist self.assert404( self.client.get('/user/e7aad618-fd86-3983-9e77-405e21796eca'))