def test_get(self): self.mock_login() response = self.get('/projects/summary/') self.assertEqual(response.code, 200) # check that correct information is printed on HTML page. for project_name in db.getProjectNames(): num_barcodes = len(db.get_barcodes_for_projects([project_name])) self.assertIn('<tr><td>%s</td>' % project_name, response.body) self.assertIn('<td>%s</td></tr>' % num_barcodes, response.body)
def test_get(self): self.mock_login() response = self.get('/projects/summary/') self.assertEqual(response.code, 200) obs = response.body.decode('utf-8') # check that correct information is printed on HTML page. for project_name in db.getProjectNames(): num_barcodes = len(db.get_barcodes_for_projects([project_name])) self.assertIn('<tr><td>%s</td>' % xhtml_escape(project_name), obs) self.assertIn('<td>%s</td></tr>' % num_barcodes, obs)
def get(self): projects = db.getProjectNames() # escape unicode project names for xhtml rendering info = [(p, len(db.get_barcodes_for_projects([p]))) for p in projects] self.render('projects_summary.html', proj_counts=info)
def get(self): projects = db.getProjectNames() info = [(p, len(db.get_barcodes_for_projects([p]))) for p in projects] self.render('projects_summary.html', proj_counts=info)