Пример #1
0
    def setUp(self):
        super(ViewTests, self).setUp()

        self.owner_id, self.app_id, _ = create_client()
        self.user, self.user_id = create_user()
        self.access_code = '1234'
        self.auth_header = {'Authorization': 'Bearer %s' % self.access_code}

        expiration = datetime.datetime(2014, 2, 23, 9, 0)

        access_code = AccessCode(code=self.access_code,
                                 code_type='Bearer',
                                 expiration=expiration,
                                 scope=['read-passwords', 'write-passwords'],
                                 application_id=self.app_id,
                                 user_id=self.user_id)
        with transaction.manager:
            Session.add(access_code)
            Session.flush()
Пример #2
0
 def setUp(self):
     super(RequestValidatorTests, self).setUp()
     self.owner_id, self.app_id, self.app_secret = create_client()
     _, self.user_id = create_user()
Пример #3
0
def create_and_login_user(testapp):
    user, user_id = create_user()
    testapp.get('/__login/' + str(user_id))
    return user, user_id
 def setUp(self):
     super(RequestValidatorTests, self).setUp()
     self.owner_id, self.app_id, self.app_secret = create_client()
     _, self.user_id = create_user()
 def setUp(self):
     super(DecoratorsTests, self).setUp()
     self.owner_id, self.app_id, _ = create_client()
     _, self.user_id = create_user()
Пример #6
0
 def setUp(self):
     super(DecoratorsTests, self).setUp()
     self.owner_id, self.app_id, _ = create_client()
     _, self.user_id = create_user()