def generate_request_and_session(self, url, auth=None, uuid=None):
        request = DummyRequest([url], {})
        session = Session(0, request)

        if auth is not None:
            session.is_authed = auth
        if uuid is not None:
            session.uuid = uuid

        request.session = session

        return request
    def test_sign_works_on_valid_credentials(self):

        request = self.generate_request(
            ["/sign_in"],
            params="""{
                "email": "*****@*****.**",
                "key": "valid"
            }""",
        )
        session = Session(0, request)
        session.uid = "73s7b33f"
        request.session = session
        result = yield self.account.render(request)

        self.assertEqual(result.code, http.OK)
        self.assertEqual(type(result.subject), dict)
        self.assertEqual(result.headers["content-type"], "application/json")
        self.assertEqual(result.subject["success"], True)
        self.assertEqual(result.subject["session_id"], "73s7b33f")