student.tests: Added db access in mock_render_to_response() to test any issues with @transaction.commit_manually

This commit is contained in:
Usman Khalid
2013-10-25 19:54:52 +05:00
committed by vagrant
parent 30861d0b3d
commit 6ddd0ae5ab

View File

@@ -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))