Skip to content

Commit bcdf9e1

Browse files
committed
Fix tests
1 parent 6735b1b commit bcdf9e1

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Diff for: drfpasswordless/serializers.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ def validate(self, attrs):
7373

7474

7575
class EmailAuthSerializer(AbstractBaseAliasAuthenticationSerializer):
76-
77-
alias_type = 'email'
76+
@property
77+
def alias_type(self):
78+
return 'email'
79+
7880
email = serializers.EmailField()
7981

8082

8183
class MobileAuthSerializer(AbstractBaseAliasAuthenticationSerializer):
84+
@property
85+
def alias_type(self):
86+
return 'mobile'
8287

83-
alias_type = 'mobile'
8488
phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$',
8589
message="Mobile number must be entered in the format:"
8690
" '+999999999'. Up to 15 digits allowed.")
@@ -140,13 +144,15 @@ def validate(self, attrs):
140144

141145

142146
class EmailVerificationSerializer(AbstractBaseAliasAuthenticationSerializer):
143-
144-
alias_type = 'email'
147+
@property
148+
def alias_type(self):
149+
return 'email'
145150

146151

147152
class MobileVerificationSerializer(AbstractBaseAliasAuthenticationSerializer):
148-
149-
alias_type = 'mobile'
153+
@property
154+
def alias_type(self):
155+
return 'mobile'
150156

151157

152158
"""

0 commit comments

Comments
 (0)