You can test it like we do here:
https://github.com/mozilla/zamboni/blob/master/mkt/downloads/tests/test_views.py#L29