def add_user4(): with app.app_context(): user = User() user.email = email4 user.password = '******' user.activation_token = activation_token user.level = UserLevel.REGISTERED user.insert() return user
def test_insert_user_with_character(self): u = User() u.email = EMAIL2 u.password = PASSWORD2 u.level = 321 u.activation_token = 'a-token for user 2' c1 = Character() c1.eve_id = 1 c1.token = 'token #1' c2 = Character() c2.eve_id = 2 c2.token = 'token #2' u.characters = [c1, c2] self.assertIsNotNone(u.insert()) u2 = user_loader(EMAIL2) self.assertTrue(isinstance(u2, User))