Esempio n. 1
0
 def test_confirm_email_get_with_campaign(self):
     user = factories.UnconfirmedUserFactory()
     user.system_tags.append(campaigns.CAMPAIGNS['prereg']['system_tag'])
     user.save()
     token = user.get_confirmation_token(user.username)
     kwargs = {
         'uid': user._id,
     }
     with self.app.app.test_request_context(), mock_auth(user):
         res = auth_views.confirm_email_get(token, **kwargs)
         assert_equal(res.status_code, http.FOUND)
         assert_equal(res.location, campaigns.CAMPAIGNS['prereg']['redirect_url']())
Esempio n. 2
0
 def test_confirm_email_get_with_campaign(self):
     for key, value in campaigns.CAMPAIGNS.items():
         user = factories.UnconfirmedUserFactory()
         user.add_system_tag(value.get('system_tag'))
         user.save()
         token = user.get_confirmation_token(user.username)
         kwargs = {
             'uid': user._id,
         }
         with self.app.app.test_request_context(), mock_auth(user):
             res = auth_views.confirm_email_get(token, **kwargs)
             assert_equal(res.status_code, http.FOUND)
             assert_equal(res.location, campaigns.campaign_url_for(key))
Esempio n. 3
0
 def test_confirm_email_get_with_campaign(self):
     for key, value in campaigns.CAMPAIGNS.items():
         user = factories.UnconfirmedUserFactory()
         user.add_system_tag(value.get('system_tag'))
         user.save()
         token = user.get_confirmation_token(user.username)
         kwargs = {
             'uid': user._id,
         }
         with self.app.app.test_request_context(), mock_auth(user):
             res = auth_views.confirm_email_get(token, **kwargs)
             assert_equal(res.status_code, http.FOUND)
             assert_equal(res.location, campaigns.campaign_url_for(key))
Esempio n. 4
0
 def test_confirm_email_get_with_campaign(self):
     user = factories.UnconfirmedUserFactory()
     user.system_tags.append(campaigns.CAMPAIGNS['prereg']['system_tag'])
     user.save()
     token = user.get_confirmation_token(user.username)
     kwargs = {
         'uid': user._id,
     }
     with self.app.app.test_request_context(), mock_auth(user):
         res = auth_views.confirm_email_get(token, **kwargs)
         assert_equal(res.status_code, http.FOUND)
         assert_equal(res.location,
                      campaigns.CAMPAIGNS['prereg']['redirect_url']())