tests.py 1021 B

12345678910111213141516171819202122232425
  1. # Copyright 2013-2016 The Distro Tracker Developers
  2. # See the COPYRIGHT file at the top-level directory of this distribution and
  3. # at http://deb.li/DTAuthors
  4. #
  5. # This file is part of Distro Tracker. It is subject to the license terms
  6. # in the LICENSE file found in the top-level directory of this
  7. # distribution and at http://deb.li/DTLicense. No part of Distro Tracker,
  8. # including this file, may be copied, modified, propagated, or distributed
  9. # except according to the terms contained in the LICENSE file.
  10. from __future__ import unicode_literals
  11. from django.test import TestCase
  12. from django_email_accounts.models import UserEmail
  13. class UserEmailTests(TestCase):
  14. def test_user_email_get_or_create_uses_case_insensitive_email(self):
  15. orig_user_email = UserEmail.objects.create(email='MyEmail@example.net')
  16. user_email, created = UserEmail.objects.get_or_create(
  17. email='myemail@example.net')
  18. self.assertFalse(created)
  19. self.assertEqual(orig_user_email.pk, user_email.pk)