Пример #1
0
class UpdatesRegistrationTestCase(unittest.TestCase):
    def setUp(self):
        self.registered_user_email = "*****@*****.**"
        self.registered_user = UpdatesRegistration(email=self.registered_user_email)
        self.registered_user.save()

    def tearDown(self):
        self.registered_user.delete()
    
    def test_if_get_register_validate_existing_user(self):
        self.assertTrue(UpdatesRegistration.objects.is_registered(self.registered_user_email))
        
    def test_if_get_register_validate_non_existing_user(self):
        self.assertFalse(UpdatesRegistration.objects.is_registered("*****@*****.**"))
Пример #2
0
class UpdatesRegistrationTestCase(unittest.TestCase):
    def setUp(self):
        self.registered_user_email = "*****@*****.**"
        self.registered_user = UpdatesRegistration(
            email=self.registered_user_email)
        self.registered_user.save()

    def tearDown(self):
        self.registered_user.delete()

    def test_if_get_register_validate_existing_user(self):
        self.assertTrue(
            UpdatesRegistration.objects.is_registered(
                self.registered_user_email))

    def test_if_get_register_validate_non_existing_user(self):
        self.assertFalse(
            UpdatesRegistration.objects.is_registered("*****@*****.**"))
Пример #3
0
 def setUp(self):
     self.registered_user_email = "*****@*****.**"
     self.registered_user = UpdatesRegistration(email=self.registered_user_email)
     self.registered_user.save()
Пример #4
0
 def notify_and_redirect(self):
     new_request = UpdatesRegistration(email=self.email)
     as_been_sent = _send_email(self.email_confirmation, EMAILS["CONTACT"]["FROM"])
     new_request.save()
     redirect = urlresolvers.reverse('updates_registration.views.register_success')
     return HttpResponseRedirect(redirect)
Пример #5
0
 def setUp(self):
     self.registered_user_email = "*****@*****.**"
     self.registered_user = UpdatesRegistration(
         email=self.registered_user_email)
     self.registered_user.save()