If you used RequestFactory instead of client.get, the test would be cleaner and you wouldn't have to remember to patch facebook.views.message in the actual tests. This way works, of course, but my personal preference is to write true unit tests instead of testing the full django stack like this.