-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testcase for testing signup get_initialmethod
- Loading branch information
varun kumar
committed
Sep 12, 2023
1 parent
68faa4a
commit 47ea67f
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,3 +315,16 @@ def test_django_password_validation(self): | |
"password1", | ||
["This password is too short. It must contain at least 9 characters."], | ||
) | ||
|
||
def test_get_initial_with_valid_email(self): | ||
"""Test that the email field is populated with a valid email.""" | ||
request = RequestFactory().get("/signup/[email protected]") | ||
from allauth.account.views import signup | ||
|
||
SessionMiddleware(lambda request: None).process_request(request) | ||
request.user = AnonymousUser() | ||
view = signup(request) | ||
view.request = request | ||
self.assertEqual( | ||
view.context_data["view"].get_initial()["email"], "[email protected]" | ||
) |