def test_get_users_list(self): common_users = users.get_users() self.assertGreaterEqual(len(common_users), 0) all_users = users.get_users(exclude_system_users=False) self.assertGreaterEqual(len(all_users), 1) self.assertGreaterEqual(all_users, common_users)
def get(self): page = int(self.get_argument('page', 1)) platform = self.get_argument('platform','') orderby = self.get_argument('orderby', 'uid') data = [] strdate, sdate, edate = parse_date(self) # if strdate: # data = users.get_user_time(sdate, edate)## # if orderby == 'total_sons': # data = users.get_users_by_ttsons(sdate,edate) #elif orderby != 'uid': if orderby == 'total_sons': data = users.get_users_by_ttsons(sdate,edate,platform) elif orderby != 'uid': data = users.get_users(sdate,edate,orderby,platform) else: data = users.get_user_time(sdate, edate,platform) #test = users.get_user_platform(sdate,edate,2,orderby) #print test result = paginator(data, page) data = { "title": "用户信息列表", "current_user": self.current_user, "users": result, "orderby": orderby, "strdate": strdate, "sdate" : strdate['s'], "edate" : strdate['e'], "platform" : platform } self.render("user/index.html", **data)
def GET(self, project_id): milestone_list = milestones.get_milestones(project_id) user_list = users.get_users() category_list = categories.get_categories(project_id) return render.issue.create( project_id=project_id, milestones=milestone_list, users=user_list, categories=category_list )
def test_create_user(self): user = '******' passwd = 'fakepass' common_users = users.get_users() with RollbackContext() as rollback: users.create_user(user, passwd) rollback.prependDefer(users.delete_user, user) new_users = users.get_users() self.assertEqual(len(new_users), len(common_users) + 1) enc_passwd = spwd.getspnam(user)[1] invalid_passwd = [None, "NP", "!", "!!", "", "LK", "*"] self.assertNotIn(enc_passwd, invalid_passwd) self.assertEqual(crypt.crypt(passwd, enc_passwd), enc_passwd)
def GET(self, project_id, id): issue = issues.get_issue(id) updates = issues.get_issue_updates(id) milestone_list = milestones.get_milestones(project_id) user_list = users.get_users() category_list = categories.get_categories(project_id) return render.issue.show( project_id=project_id, issue=issue, updates=updates, milestones=milestone_list, users=user_list, categories=category_list, )
def index(): if request.method == "GET": users = get_users() return render_template('index.html')
def resp(): users = get_users() return render_template('users.html', users = users)
def GET(self, project_id, id): category = categories.get_category(id) user_list = users.get_users() return render.category(project_id=project_id, category=category, users=user_list)
def GET(self, project_id): user_list = users.get_users() return render.new_category(project_id=project_id, users=user_list)
def get_users(full_data=False): return json.dumps(users.get_users(full_data=full_data))