We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61a5ab2 commit fe2c193Copy full SHA for fe2c193
easy_api/users/tests/test_adapters.py
@@ -0,0 +1,24 @@
1
+from unittest.mock import Mock
2
+
3
+from django.conf import settings
4
5
+from easy_api.users.adapters import AccountAdapter, SocialAccountAdapter
6
7
8
+def test_adapters(monkeypatch):
9
+ with monkeypatch.context() as m:
10
+ m.setattr(
11
+ settings,
12
+ "ACCOUNT_ALLOW_REGISTRATION",
13
+ True
14
+ )
15
+ adapter = AccountAdapter()
16
+ assert adapter.is_open_for_signup(request=Mock())
17
18
19
20
21
+ False
22
23
+ adapter = SocialAccountAdapter()
24
+ assert adapter.is_open_for_signup(request=Mock(), sociallogin=Mock()) is False
0 commit comments