'Test that HTTPException\'s headers are extended properly'

def test_exception_header_forwarded(self):

    app = Flask(__name__)
    app.config['DEBUG'] = True
    api = flask_restful.Api(app)
    class NotModified(HTTPException, ):
        code = 304
        def __init__(self, etag, *args, **kwargs):
            super(NotModified, self).__init__(*args, **kwargs)
            self.etag = quote_etag(etag)
        def get_headers(self, *args, **kwargs):
            'Get    a    list    of    headers.'
            return [('ETag', self.etag)]
    class Foo1(flask_restful.Resource, ):
        def get(self):
            flask_abort(304, etag='myETag')
    api.add_resource(Foo1, '/foo')
    _aborter.mapping.update({304: NotModified})
    with app.test_client() as client:
        foo = client.get('/foo')
        self.assertEquals(foo.get_etag(), unquote_etag(quote_etag('myETag')))
