Exemplo n.º 1
0
    def test_authenticated_get(self):
        request = RequestFactory().get(reverse('invitations:send-json-invite'),
                                       content_type='application/json')
        request.user = self.user
        response = SendJSONInvite.as_view()(request)

        self.assertEqual(response.status_code, 405)
Exemplo n.º 2
0
    def test_anonymous_get(self):
        request = RequestFactory().get(reverse('invitations:send-json-invite'),
                                       content_type='application/json')
        request.user = AnonymousUser()
        response = SendJSONInvite.as_view()(request)

        self.assertEqual(response.status_code, 302)
Exemplo n.º 3
0
    def test_anonymous_get(self):
        request = RequestFactory().get(
            reverse('invitations:send-json-invite'),
            content_type='application/json')
        request.user = AnonymousUser()
        response = SendJSONInvite.as_view()(request)

        assert response.status_code == 302
Exemplo n.º 4
0
    def test_authenticated_get(self, settings, user_a):
        settings.INVITATIONS_ALLOW_JSON_INVITES = True
        request = RequestFactory().get(reverse('invitations:send-json-invite'),
                                       content_type='application/json')
        request.user = user_a
        response = SendJSONInvite.as_view()(request)

        assert response.status_code == 405
Exemplo n.º 5
0
    def test_authenticated_get(self):
        request = RequestFactory().get(
            reverse('invitations:send-json-invite'),
            content_type='application/json')
        request.user = self.user
        response = SendJSONInvite.as_view()(request)

        self.assertEqual(response.status_code, 405)
Exemplo n.º 6
0
    def test_authenticated_get(self, settings, user_a):
        settings.INVITATIONS_ALLOW_JSON_INVITES = True
        request = RequestFactory().get(
            reverse('invitations:send-json-invite'),
            content_type='application/json')
        request.user = user_a
        response = SendJSONInvite.as_view()(request)

        assert response.status_code == 405
Exemplo n.º 7
0
    def test_anonymous_get(self):
        request = RequestFactory().get(
            reverse("invitations:send-json-invite"),
            content_type="application/json",
        )
        request.user = AnonymousUser()
        response = SendJSONInvite.as_view()(request)

        assert response.status_code == 302