|
@@ -107,6 +107,29 @@ class TestIndexView(
|
107
|
107
|
page = self.get(reverse("checkout:index"))
|
108
|
108
|
self.assertEqual(email, page.form["username"].value)
|
109
|
109
|
|
|
110
|
+ def test_auto_select_existing_user(self):
|
|
111
|
+ email = "forgetfulguest@test.com"
|
|
112
|
+ self.create_user(email, email, self.password)
|
|
113
|
+
|
|
114
|
+ self.add_product_to_basket()
|
|
115
|
+
|
|
116
|
+ # select guest checkout
|
|
117
|
+ page = self.get(reverse("checkout:index"))
|
|
118
|
+ form = page.form
|
|
119
|
+ form["options"].select(GatewayForm.GUEST)
|
|
120
|
+ form["username"].value = email
|
|
121
|
+
|
|
122
|
+ response = form.submit()
|
|
123
|
+
|
|
124
|
+ # since this user allready exists
|
|
125
|
+ self.assertEqual(email, response.form["username"].value)
|
|
126
|
+ self.assertEqual(
|
|
127
|
+ GatewayForm.EXISTING,
|
|
128
|
+ response.form["options"].value,
|
|
129
|
+ "Since this user has an account, the GatewayForm should "
|
|
130
|
+ "be changed to existing, so the user can enter his password",
|
|
131
|
+ )
|
|
132
|
+
|
110
|
133
|
|
111
|
134
|
@override_settings(OSCAR_ALLOW_ANON_CHECKOUT=True)
|
112
|
135
|
class TestShippingAddressView(
|