Example #1
0
    def test_it_raises_on_any_other_SQLAlchemy_exception(self, factories):
        fake_session = mock.Mock()
        fake_session.flush.side_effect = SQLAlchemyError("foo")

        update_svc = GroupUpdateService(session=fake_session)
        group = factories.Group(authority_provided_id="foo", authority="foo.com")

        with pytest.raises(SQLAlchemyError):
            update_svc.update(group, name="fingers")
Example #2
0
    def test_it_raises_on_any_other_SQLAlchemy_exception(self, factories):
        fake_session = mock.Mock()
        fake_session.flush.side_effect = SQLAlchemyError("foo")

        update_svc = GroupUpdateService(session=fake_session)
        group = factories.Group(authority_provided_id="foo",
                                authority="foo.com")

        with pytest.raises(SQLAlchemyError):
            update_svc.update(group, name="fingers")
Example #3
0
def svc(db_session):
    return GroupUpdateService(session=db_session)