コード例 #1
0
    def test_fetch_profile_post_good_data_200(self):
        self.valid_site.secret = ENTREE['SECRET_KEY']
        self.valid_site.save()

        fetcher = EntreeUserFetcherMixin()
        token = self.user.create_token()

        fetch_params = fetcher._fetch_params(token.value)

        self.request.method = 'POST'
        self.request.POST = fetch_params

        ViewClass = ProfileFetchView.as_view()
        view = ViewClass(self.request)

        assert_equals(200, view.status_code)
コード例 #2
0
ファイル: test_views.py プロジェクト: SanomaCZ/django-entree
    def test_fetch_profile_post_good_data_200(self):
        self.valid_site.secret = ENTREE["SECRET_KEY"]
        self.valid_site.save()

        fetcher = EntreeUserFetcherMixin()
        token = self.user.create_token()

        fetch_params = fetcher._fetch_params(token.value)

        self.request.method = "POST"
        self.request.POST = fetch_params

        ViewClass = ProfileFetchView.as_view()
        view = ViewClass(self.request)

        assert_equals(200, view.status_code)
コード例 #3
0
    def test_fetch_profile_invalid_checksum_403(self):
        self.valid_site.secret = ENTREE['SECRET_KEY']
        self.valid_site.save()

        fetcher = EntreeUserFetcherMixin()
        token = self.user.create_token()

        fetch_params = fetcher._fetch_params(token.value)
        fetch_params['checksum'] = 'foo'

        self.request.method = 'POST'
        self.request.POST = fetch_params

        ViewClass = ProfileFetchView.as_view()
        view = ViewClass(self.request)

        assert_equals(403, view.status_code)
コード例 #4
0
ファイル: test_views.py プロジェクト: SanomaCZ/django-entree
    def test_fetch_profile_invalid_checksum_403(self):
        self.valid_site.secret = ENTREE["SECRET_KEY"]
        self.valid_site.save()

        fetcher = EntreeUserFetcherMixin()
        token = self.user.create_token()

        fetch_params = fetcher._fetch_params(token.value)
        fetch_params["checksum"] = "foo"

        self.request.method = "POST"
        self.request.POST = fetch_params

        ViewClass = ProfileFetchView.as_view()
        view = ViewClass(self.request)

        assert_equals(403, view.status_code)