Beispiel #1
0
    def create_api_key(self, user_id):
        """Create api-key."""
        from invenio.modules.apikeys import create_new_web_api_key, \
            get_available_web_api_keys

        create_new_web_api_key(user_id,
                               key_description='test key for user id %s' %
                               user_id)
        keys = get_available_web_api_keys(self.userid)
        self.apikey = keys[0].id
Beispiel #2
0
    def create_api_key(self, user_id):
        from invenio.modules.apikeys import create_new_web_api_key, \
            get_available_web_api_keys

        create_new_web_api_key(
            user_id,
            key_description='test key for user id %s' % user_id
        )
        keys = get_available_web_api_keys(self.userid)
        self.apikey = keys[0].id
    def setUp(self):
        from random import randint
        from invenio.modules.apikeys import create_new_web_api_key, \
            get_available_web_api_keys
        #FIXME unknown import 'deposition_metadata'
        from invenio.modules.deposit.loader import deposition_metadata
        # self.clear_tables()

        create_new_web_api_key(1, key_description='webdeposit_api_testing')
        keys = get_available_web_api_keys(1)
        self.apikey = keys[0].id

        # Test random deposition
        self.deposition = deposition_metadata.keys()[randint(0, len(deposition_metadata.keys()) - 1)]
        super(TestWebDepositAPI, self).setUp()
Beispiel #4
0
    def setUp(self):
        from random import randint
        from invenio.modules.apikeys import create_new_web_api_key, \
            get_available_web_api_keys
        #FIXME unknown import 'deposition_metadata'
        from invenio.modules.deposit.loader import deposition_metadata
        # self.clear_tables()

        create_new_web_api_key(1, key_description='webdeposit_api_testing')
        keys = get_available_web_api_keys(1)
        self.apikey = keys[0].id

        # Test random deposition
        self.deposition = deposition_metadata.keys()[randint(
            0,
            len(deposition_metadata.keys()) - 1)]
        super(TestWebDepositAPI, self).setUp()