def post(self): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return testcode = self.request.get('testcode') d = json.loads(testcode) assert (d) det = Story.api_index(d['lang']) self.redirect(self.request.url + 'input?result=' + str(det))
def post(self): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return testcode = self.request.get('testcode') d = json.loads(testcode) assert(d) det = Story.api_index(d['lang']) self.redirect(self.request.url + 'input?result='+str(det))
def test_story_index(): for lang in conftest.langs(): det = Story.api_index(lang) assert True == det['success']
def get(self): self.response.headers['Content-Type'] = 'application/json' lang = self.request.get('lang') ret = Story.api_index(lang) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(ret))