Commit dbb57ad3 authored by Michal Čihař's avatar Michal Čihař

Use and test own code for adding email

It provides form validation with better feedback.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent ceb55fbc
......@@ -229,9 +229,16 @@ class RegistrationTest(TestCase, RegistrationTestMixin):
)
self.assertContains(response, 'Register email')
# Try invalid address first
response = self.client.post(
reverse('email_login'),
{'email': 'invalid'},
)
self.assertContains(response, 'has-error')
# Add email account
response = self.client.post(
reverse('social:complete', kwargs={'backend': 'email'}),
reverse('email_login'),
{'email': 'second@example.net'},
follow=True,
)
......
......@@ -10,7 +10,7 @@
{% show_message "error" _("Please fix errors in the registration form.") %}
{% endif %}
<form action="{% url 'social:complete' "email" %}" method="post" accept-charset="utf-8">
<form action="{% url 'email_login' %}" method="post" accept-charset="utf-8">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Register email" %}</h4></div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment