From a93b7f5cec9873a6eb97a92f055306b11330548b Mon Sep 17 00:00:00 2001 From: Poderyagin Egor Date: Sun, 13 Dec 2015 22:24:27 +0300 Subject: [PATCH] Added test case for reset by email in different case --- rest_auth/tests/test_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rest_auth/tests/test_api.py b/rest_auth/tests/test_api.py index 7adcf71..b64cf8c 100644 --- a/rest_auth/tests/test_api.py +++ b/rest_auth/tests/test_api.py @@ -224,6 +224,15 @@ class APITestCase1(TestCase, BaseAPITestCase): } self.post(self.login_url, data=payload, status_code=200) + def test_password_reset_with_email_in_different_case(self): + user = get_user_model().objects.create_user(self.USERNAME, self.EMAIL.lower(), self.PASS) + + # call password reset in upper case + mail_count = len(mail.outbox) + payload = {'email': self.EMAIL.upper()} + self.post(self.password_reset_url, data=payload, status_code=200) + self.assertEqual(len(mail.outbox), mail_count + 1) + def test_password_reset_with_invalid_email(self): get_user_model().objects.create_user(self.USERNAME, self.EMAIL, self.PASS)