def test_random_source(self, authenticate_mock):
     backend = MozilliansAuthBackend()
     request_mock = Mock()
     request_mock.META = {'HTTP_REFERER': settings.SITE_URL + '/?source=foobar'}
     backend.request = request_mock
     backend.authenticate(request=request_mock)
     eq_(backend.referral_source, None)
 def test_get_involved_source(self, authenticate_mock):
     backend = MozilliansAuthBackend()
     request_mock = Mock()
     request_mock.META = {'HTTP_REFERER': settings.SITE_URL + '/?source=contribute'}
     backend.request = request_mock
     backend.authenticate(request=request_mock)
     eq_(backend.referral_source, 'contribute')
Esempio n. 3
0
 def test_random_source(self, authenticate_mock):
     backend = MozilliansAuthBackend()
     request_mock = Mock()
     request_mock.META = {
         'HTTP_REFERER': settings.SITE_URL + '/?source=foobar'
     }
     backend.request = request_mock
     backend.authenticate(request=request_mock)
     eq_(backend.referral_source, None)
Esempio n. 4
0
 def test_get_involved_source(self, authenticate_mock):
     backend = MozilliansAuthBackend()
     request_mock = Mock()
     request_mock.META = {
         'HTTP_REFERER': settings.SITE_URL + '/?source=contribute'
     }
     backend.request = request_mock
     backend.authenticate(request=request_mock)
     eq_(backend.referral_source, 'contribute')