Below is a collection of django unit test cases.
Test URL can be visited with status code 200
1 | from django.core.urlresolvers import reverse |
Test URL response with status code 404
1 | class BoardTopicsTests(TestCase): |
Test URL and view function
1 | class HomeTests(TestCase): |
Test HTML contains the correct URL
1 |
|
Test HTML contains CSRF token
1 | class NewTopicTests(TestCase): |
Test HTML contains form
1 | def test_contains_form(self): # <- new test |
Test form validation errors
1 |
|
Test redirection
1 | def test_redirection(self): |
Test whether user is login
1 | def test_user_authentication(self): |
Test form fields
1 | from django.test import TestCase |