Skip to content

Commit fe2c193

Browse files
committed
100% test coverage
1 parent 61a5ab2 commit fe2c193

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
m.setattr(
19+
settings,
20+
"ACCOUNT_ALLOW_REGISTRATION",
21+
False
22+
)
23+
adapter = SocialAccountAdapter()
24+
assert adapter.is_open_for_signup(request=Mock(), sociallogin=Mock()) is False

0 commit comments

Comments
 (0)