def test_dissociate_second_user_before_first(first_user, second_user, line): with user_and_line_associated(first_user, line), user_and_line_associated(second_user, line): response = confd.users(first_user['id']).lines(line['id']).delete() response.assert_match(400, secondary_user_regex)
def test_delete_user_when_user_and_line_associated(user, line): with user_and_line_associated(user, line): response = confd.users(user['id']).delete() response.assert_match(400, e.resource_associated('User', 'Line'))
def test_associate_when_user_already_associated_to_another_line(user, first_line, second_line): with user_and_line_associated(user, first_line): response = confd.users(user['id']).lines.post(line_id=first_line['id']) response.assert_match(400, e.resource_associated('User', 'Line'))