# Path: kinto-remote-settings/tests/signer/support.py
# class BaseWebTest(CoreWebTest):
#     def __init__(self, *args, **kwargs):
#     def get_app_settings(cls, extras=None):


import random
import re
import string
import unittest
from unittest import mock
from kinto.core.errors import ERRORS
from kinto.core.testing import FormattedErrorMixin
from .support import BaseWebTest, get_user_headers

        self.mocked_autograph.post.return_value.json.side_effect = fake_sign

    @classmethod
    def get_app_settings(cls, extras=None):
        settings = super().get_app_settings(extras)

        settings["storage_backend"] = "kinto.core.storage.postgresql"
        db = "postgresql://postgres:postgres@localhost/testdb"
        settings["storage_url"] = db
        settings["permission_backend"] = "kinto.core.permission.postgresql"
        settings["permission_url"] = db
        settings["cache_backend"] = "kinto.core.cache.memory"

        settings["statsd_url"] = "udp://127.0.0.1:8125"

        settings["kinto.signer.resources"] = "%s -> %s" % (
            cls.source_collection,
            cls.destination_collection,
        )
        return settings


class SignoffWebTest(PostgresWebTest):
    def setUp(self):
        super(SignoffWebTest, self).setUp()
        self.headers = get_user_headers("tarte:en-pion")
        resp = self.app.get("/", headers=self.headers)
        self.userid = resp.json["user"]["id"]


# Path: kinto-remote-settings/tests/signer/support.py
# class BaseWebTest(CoreWebTest):
#     def __init__(self, *args, **kwargs):
#     def get_app_settings(cls, extras=None):


# Path: kinto-remote-settings/tests/signer/test_signoff_flow.py
import random
import re
import string
import unittest
from unittest import mock
from kinto.core.errors import ERRORS
from kinto.core.testing import FormattedErrorMixin
from .support import BaseWebTest, get_user_headers


        self.mocked_autograph.post.return_value.json.side_effect = fake_sign

    @classmethod
    def get_app_settings(cls, extras=None):
        settings = super().get_app_settings(extras)

        settings["storage_backend"] = "kinto.core.storage.postgresql"
        db = "postgresql://postgres:postgres@localhost/testdb"
        settings["storage_url"] = db
        settings["permission_backend"] = "kinto.core.permission.postgresql"
        settings["permission_url"] = db
        settings["cache_backend"] = "kinto.core.cache.memory"

        settings["statsd_url"] = "udp://127.0.0.1:8125"

        settings["kinto.signer.resources"] = "%s -> %s" % (
            cls.source_collection,
            cls.destination_collection,
        )
        return settings


class SignoffWebTest(PostgresWebTest):
    def setUp(self):
        super(SignoffWebTest, self).setUp()
        self.headers = get_user_headers("tarte:en-pion")
        resp = self.app.get("/", headers=self.headers)
        self.userid = resp.json["user"]["id"]


        self.other_headers = get_user_headers("Sam:Wan Heilss")