Skip to content

Instantly share code, notes, and snippets.

@edwelker
Created August 11, 2013 04:40
Show Gist options
  • Save edwelker/6203414 to your computer and use it in GitHub Desktop.
Save edwelker/6203414 to your computer and use it in GitHub Desktop.
Extra assertions for django_nose
***
assert_redirects(response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix='')
assert_contains(response, text, count=None, status_code=200, msg_prefix='')
assert_not_contains(response, text, count=None, status_code=200, msg_prefix='')
assert_form_error(response, form, field, errors, msg_prefix='')
assert_template_used(response, template_name, msg_prefix='')
assert_template_not_used(response, template_name, msg_prefix='')
assert_queryset_equal(qs, values, transform=repr)
assert_num_queries(num, func=None, *args, **kwargs)
assert_code(response, status_code, msg_prefix='')
assert_ok(response, msg_prefix='')
assert_mail_count(count, msg=None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment