108536490: Initial effort to implement log in

Add endpoint for post to /sign-in
Initialise role data
This commit is contained in:
Rebecca Law
2015-12-01 10:00:06 +00:00
parent 4d2b9c7fc2
commit 7f96ef5a25
17 changed files with 183 additions and 56 deletions
+6 -3
View File
@@ -13,9 +13,12 @@ def test_insert_role_should_be_able_to_get_role(notifications_admin, notificatio
assert saved_role == role
def test_insert_role_will_throw_error_if_role_already_exists():
def test_insert_role_will_throw_error_if_role_already_exists(notifications_admin, notifications_admin_db):
role1 = roles_dao.get_role_by_id(1)
assert role1.id == 1
role = Roles(id=1, role='cannot create a duplicate')
with pytest.raises(sqlalchemy.exc.IntegrityError) as error:
with pytest.raises(sqlalchemy.orm.exc.FlushError) as error:
roles_dao.insert_role(role)
assert 'duplicate key value violates unique constraint "roles_pkey"' in str(error.value)
assert 'conflicts with persistent instance' in str(error.value)