def test_category_new(): facebookid = "*****@*****.**" account = Account.get_by_facebookid(facebookid) key_name = "TOEIC" category = Category.new(key_name, account) assert None != category return
def test_category_new(): facebookid = "*****@*****.**" account = Account.get_by_facebookid(facebookid) key_name = "TOEIC" category = Category.new(key_name,account) assert None != category return
def post(self): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return key_name = self.request.get('key_name') assert(None!=re.match('^[A-Z0-9]+', key_name)) category = Category.new(key_name,account) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) category.setter(params) self.redirect('/category')
def post(self): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return key_name = self.request.get('key_name') assert (None != re.match('^[A-Z0-9]+', key_name)) category = Category.new(key_name, account) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) category.setter(params) self.redirect('/category')