File: oauth1_server.py

package info (click to toggle)
python-authlib 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,016 kB
  • sloc: python: 26,998; makefile: 53; sh: 14
file content (20 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os

from authlib.integrations.django_oauth1 import CacheAuthorizationServer
from tests.django_helper import TestCase as _TestCase

from .models import Client
from .models import TokenCredential


class TestCase(_TestCase):
    def setUp(self):
        super().setUp()
        os.environ["AUTHLIB_INSECURE_TRANSPORT"] = "true"

    def tearDown(self):
        os.environ.pop("AUTHLIB_INSECURE_TRANSPORT")
        super().tearDown()

    def create_server(self):
        return CacheAuthorizationServer(Client, TokenCredential)