Testing

Test Class Helpers

BaseViewTestCase provides a useful framework for testing views. It handles the setup of requests and simplifies common url operations for views in the same installed app.

Reversing URLS

Due to the way the urls are configured, tests for the Apply site will fail as the Apply site does not use the default URL config.
This can be resolved on a per testcase basis using the following:
1
from django.test import TestCase, override_settings
2
3
@override_settings(ROOT_URLCONF='hypha.apply.urls')
4
class MyTestCase(TestCase):
5
pass
Copied!
This is implemented by default for the BaseViewTestCase
Last modified 3mo ago