Пример #1
0
    def test_nonexistent_email(self, db_session):
        EmailMessageFactory.create()

        request = pretend.stub(matchdict={"email_id": str(uuid.uuid4())}, db=db_session)

        with pytest.raises(HTTPNotFound):
            views.email_detail(request)
Пример #2
0
    def test_nonexistent_email(self, db_session):
        EmailMessageFactory.create()

        request = pretend.stub(matchdict={"email_id": str(uuid.uuid4())}, db=db_session)

        with pytest.raises(HTTPNotFound):
            views.email_detail(request)
Пример #3
0
    def test_existing_email(self, db_session):
        em = EmailMessageFactory.create()

        request = pretend.stub(
            matchdict={"email_id": em.id},
            db=db_session,
        )

        assert views.email_detail(request) == {"email": em}
Пример #4
0
    def test_existing_email(self, db_session):
        em = EmailMessageFactory.create()

        request = pretend.stub(
            matchdict={"email_id": em.id},
            db=db_session,
        )

        assert views.email_detail(request) == {"email": em}