예제 #1
0
파일: models.py 프로젝트: francisl/vcms
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
파일: views.py 프로젝트: francisl/vcms
 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)