def test_get_provider_index2(self): r2_factory = RequestFactory() request2 = r2_factory.get('/sso/saml/?provider=2ndProvider') provider2, index2 = get_provider_index(request2) self.assertEqual(provider2, '2ndProvider') self.assertEqual(index2, 1)
def test_get_provider_index_missing_query_str(self): r2_factory = RequestFactory() request2 = r2_factory.get('/sso/saml/') provider, index = get_provider_index(request2) self.assertEqual(provider, 'MyProvider')
def test_get_provider_index1(self): r1_factory = RequestFactory() request1 = r1_factory.get('/sso/saml/?provider=MyProvider') provider1, index1 = get_provider_index(request1) self.assertEqual(provider1, 'MyProvider') self.assertEqual(index1, 0)