Add test for main.views.pdf_view.
Replace try/except with proper response code checking.
Remove redundant code.
Merge pull request #12 from stemchan/pdfviewtest

Add test for main.views.pdf_view.