Skip to content

Commit e475175

Browse files
committed
added settings test
1 parent be5f96b commit e475175

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/test_settings.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
self.assertEqual(settings.B, 3)

0 commit comments

Comments
 (0)