def test_pin_on_cookie(self):
        self.request.COOKIES[PINNING_COOKIE] = 'y'
        self.middleware.process_request(self.request)
        assert this_thread_is_pinned()
Thread should pin when the cookie is set.
dataset/ETHPy150Open jbalogh/django-multidb-router/multidb/tests.py/MiddlewareTests.test_pin_on_cookie