Render_to_string and response.content.decode() not matching
The request
argument was added to render_to_string
in Django 1.8. You could try changing the line in your test to:
expected_html = render_to_string('home.html', request=request)
It's only required to make this change in Django 1.9+, the test passes without the request in Django 1.8.