def assert_doesnt_render(expected, template, **kwargs): "Asserts than a given template and context don't render a given fragment" eq_(expected, render(template, **kwargs))
def assert_code(response, code): "Assert that a given response returns a given HTTP status code" eq_(code, response.status_code, "HTTP Response status code %d expected, but got %d" % (code, response.status_code))