@ -10,7 +10,7 @@ from django.conf import settings | |||||
class LoginTestCase(TestCase): | class LoginTestCase(TestCase): | ||||
def test_it_sends_link(self): | def test_it_sends_link(self): | ||||
form = {"email": "[email protected]"} | |||||
form = {"identity": "[email protected]"} | |||||
r = self.client.post("/accounts/login/", form) | r = self.client.post("/accounts/login/", form) | ||||
assert r.status_code == 302 | assert r.status_code == 302 | ||||
@ -34,17 +34,17 @@ class LoginTestCase(TestCase): | |||||
@override_settings(REGISTRATION_OPEN=False) | @override_settings(REGISTRATION_OPEN=False) | ||||
def test_it_obeys_registration_open(self): | def test_it_obeys_registration_open(self): | ||||
form = {"email": "[email protected]"} | |||||
form = {"identity": "[email protected]"} | |||||
r = self.client.post("/accounts/login/", form) | r = self.client.post("/accounts/login/", form) | ||||
assert r.status_code == 200 | assert r.status_code == 200 | ||||
self.assertContains(r, "Incorrect email") | self.assertContains(r, "Incorrect email") | ||||
def test_it_ignores_ces(self): | |||||
def test_it_ignores_case(self): | |||||
alice = User(username="alice", email="[email protected]") | alice = User(username="alice", email="[email protected]") | ||||
alice.save() | alice.save() | ||||
form = {"email": "[email protected]"} | |||||
form = {"identity": "[email protected]"} | |||||
r = self.client.post("/accounts/login/", form) | r = self.client.post("/accounts/login/", form) | ||||
assert r.status_code == 302 | assert r.status_code == 302 | ||||
@ -18,16 +18,16 @@ | |||||
<form id="magic-link-form" method="post"> | <form id="magic-link-form" method="post"> | ||||
{% csrf_token %} | {% csrf_token %} | ||||
{% if magic_form.email.errors %} | |||||
{% if magic_form.errors %} | |||||
<p class="text-danger">Incorrect email address.</p> | <p class="text-danger">Incorrect email address.</p> | ||||
{% else %} | {% else %} | ||||
<p>Enter your <strong>email address</strong>.</p> | <p>Enter your <strong>email address</strong>.</p> | ||||
{% endif %} | {% endif %} | ||||
<input | <input | ||||
type="text" | |||||
type="email" | |||||
class="form-control input-lg" | class="form-control input-lg" | ||||
name="email" | |||||
name="identity" | |||||
value="{{ magic_form.email.value|default:"" }}" | value="{{ magic_form.email.value|default:"" }}" | ||||
placeholder="[email protected]"> | placeholder="[email protected]"> | ||||
@ -53,7 +53,7 @@ | |||||
{% csrf_token %} | {% csrf_token %} | ||||
<input type="hidden" name="action" value="login" /> | <input type="hidden" name="action" value="login" /> | ||||
{% if form.non_field_errors %} | |||||
{% if form.errors %} | |||||
<p class="text-danger">Incorrect email or password.</p> | <p class="text-danger">Incorrect email or password.</p> | ||||
{% else %} | {% else %} | ||||
<p> | <p> | ||||
@ -62,7 +62,7 @@ | |||||
{% endif %} | {% endif %} | ||||
<input | <input | ||||
type="text" | |||||
type="email" | |||||
class="form-control input-lg" | class="form-control input-lg" | ||||
name="email" | name="email" | ||||
value="{{ form.email.value|default:"" }}" | value="{{ form.email.value|default:"" }}" | ||||