def generate_token(self): """Generates new access token for this user.""" if self.state == STATE_ACTIVE: return Token.generate_token(self.id) else: raise InactiveUserException( "Can't generate token for inactive user.")
def setUp(self): super(MusicBrainzViewsTestCase, self).setUp() current_app.config[ 'REPLICATION_PACKETS_DIR'] = self.path = tempfile.mkdtemp() os.mkdir(os.path.join(self.path, DAILY_SUBDIR)) os.mkdir(os.path.join(self.path, WEEKLY_SUBDIR)) self.token = Token.generate_token(owner_id=None)
def setUp(self): super(MusicBrainzViewsTestCase, self).setUp() current_app.config[ 'REPLICATION_PACKETS_DIR'] = self.path = tempfile.mkdtemp() current_app.config[ 'JSON_DUMPS_DIR'] = self.json_path = tempfile.mkdtemp() self.token = Token.generate_token(owner_id=None)
def setUp(self): super(MusicBrainzViewsTestCase, self).setUp() current_app.config['REPLICATION_PACKETS_DIR'] = self.path = tempfile.mkdtemp() os.mkdir(os.path.join(self.path, DAILY_SUBDIR)) os.mkdir(os.path.join(self.path, WEEKLY_SUBDIR)) self.token = Token.generate_token(owner_id=None)
def generate_token(self): """Generates new access token for this user.""" if self.state == STATE_ACTIVE: return Token.generate_token(self.id) else: raise InactiveUserException("Can't generate token for inactive user.")
def setUp(self): super(MusicBrainzViewsTestCase, self).setUp() current_app.config['REPLICATION_PACKETS_DIR'] = self.path = tempfile.mkdtemp() current_app.config['JSON_DUMPS_DIR'] = self.json_path = tempfile.mkdtemp() self.token = Token.generate_token(owner_id=None)