def test_request_admin_is_approved(self): hub_request = fixtures.get_hub_request() admin = HubRequestAdmin(HubRequest, self.site) request = self.factory.post("/", {"status": HubRequest.APPROVED}) request._messages = utils.TestMessagesBackend(request) response = admin.approve_request(request, hub_request.id) eq_(response.status_code, 302) eq_(response["Location"], "/admin/hubs/hubrequest/%s/" % hub_request.id) instance = HubRequest.objects.get(id=hub_request.id) ok_(instance.hub) self._tear_down()
def test_is_pending(self): user = get_user('us-ignite') instance = fixtures.get_hub_request( user=user, status=HubRequest.PENDING) eq_(instance.is_pending(), True) eq_(instance.hub, None)
def test_is_removed(self): user = get_user('us-ignite') instance = fixtures.get_hub_request( user=user, status=HubRequest.REMOVED) eq_(instance.is_removed(), True)
def test_admin_url(self): user = get_user('us-ignite') instance = fixtures.get_hub_request(user=user) eq_(instance.get_admin_url(), '/admin/hubs/hubrequest/%s/' % instance.id)