Exemple #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)
    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)
Exemple #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}
Exemple #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}