Beispiel #1
0
 def test_redirect_for_many_organizations(self):
     '''
     If the user is a member of many organizations then on login
     they should be redirected to the organization list page
     which shows all the organizations to which they belong.
     '''
     OrganizationUserFactory(user=self.user)
     OrganizationUserFactory(user=self.user)
     org_redirect_view = OrganizationRedirectView()
     org_redirect_view.request = self.login_request
     url = org_redirect_view.get_redirect_url()
     self.assertEquals(url, reverse('organization_list'))
Beispiel #2
0
 def test_redirect_for_many_organizations(self):
     '''
     If the user is a member of many organizations then on login
     they should be redirected to the organization list page
     which shows all the organizations to which they belong.
     '''
     OrganizationUserFactory(user=self.user)
     OrganizationUserFactory(user=self.user)
     org_redirect_view = OrganizationRedirectView()
     org_redirect_view.request = self.login_request
     url = org_redirect_view.get_redirect_url()
     self.assertEquals(url, reverse('organization_list'))
Beispiel #3
0
 def test_redirect_for_one_organization(self):
     '''
     If the user is a member of only one organization then on login
     they should be redirected to the default Decision status list for 
     that one organization and not the organization list page.
     '''
     org_user = OrganizationUserFactory(user=self.user)
     org_redirect_view = OrganizationRedirectView()
     org_redirect_view.request = self.login_request
     url = org_redirect_view.get_redirect_url()
     expected_url = reverse('publicweb_item_list',
                            args=[org_user.organization.slug, 'discussion'])
     self.assertEqual(url, expected_url)
Beispiel #4
0
 def test_redirect_for_one_organization(self):
     '''
     If the user is a member of only one organization then on login
     they should be redirected to the default Decision status list for 
     that one organization and not the organization list page.
     '''
     org_user = OrganizationUserFactory(user=self.user)
     org_redirect_view = OrganizationRedirectView()
     org_redirect_view.request = self.login_request
     url = org_redirect_view.get_redirect_url()
     expected_url = reverse('publicweb_item_list',
                            args=[org_user.organization.slug,
                                  DecisionList.DEFAULT])
     self.assertEqual(url, expected_url)
Beispiel #5
0
 def test_redirect_for_one_organization(self):
     '''
     If the user is a member of only one organization then on login
     they should be redirected to the proposal page for that one
     organization and not the organization list page.
     '''
     org_user_factory = OrganizationUserFactory(user=self.user)
     org_redirect_view = OrganizationRedirectView()
     org_redirect_view.request = self.login_request
     response = org_redirect_view.get_redirect_url()
     expected_url = reverse('publicweb_item_list',
                            args=[org_user_factory.organization.slug,
                                  'proposal'])
     self.assertEqual(response, expected_url)