Commit 6ddd0ae5 by Usman Khalid Committed by vagrant

student.tests: Added db access in mock_render_to_response() to test any issues…

student.tests: Added db access in mock_render_to_response() to test any issues with @transaction.commit_manually
parent 30861d0b
......@@ -25,6 +25,9 @@ def mock_render_to_string(template_name, context):
def mock_render_to_response(template_name, context):
"""Return an HttpResponse with content that encodes template_name and context"""
# View confirm_email_change uses @transaction.commit_manually.
# This simulates any db access in the templates.
UserProfile.objects.exists()
return HttpResponse(mock_render_to_string(template_name, context))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment