'Tests encoding a coreapi objects raises proper error'

def test_encode_coreapi_raises_error(self):

    with pytest.raises(RuntimeError):
        self.encoder.default(coreapi.Document())
    with pytest.raises(RuntimeError):
        self.encoder.default(coreapi.Error())
