We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be5f96b commit e475175Copy full SHA for e475175
tests/test_settings.py
@@ -0,0 +1,31 @@
1
+from django.test import TestCase
2
+from django.test.utils import override_settings
3
+
4
+from rest_registration.settings import RegistrationSettings
5
6
7
+class RegistrationSettingsTestCase(TestCase):
8
9
+ def setUp(self):
10
+ self.defaults = {
11
+ 'A': 2,
12
+ 'B': 3,
13
+ }
14
15
+ def test_user_settings(self):
16
+ user_settings = {
17
+ 'A': 1,
18
19
+ settings = RegistrationSettings(user_settings, self.defaults, ())
20
+ self.assertEqual(settings.A, 1)
21
+ self.assertEqual(settings.B, 3)
22
23
+ @override_settings(
24
+ REST_REGISTRATION={
25
+ 'A': 5,
26
27
+ )
28
+ def test_django_settings(self):
29
+ settings = RegistrationSettings(None, self.defaults, ())
30
+ self.assertEqual(settings.A, 5)
31
0 commit comments