def test_by_domain(self): domain = uuid.uuid4().hex config = _make_performance_config(domain) results = dbaccessors.by_domain(domain) self.assertEqual(1, len(results)) self.assertEqual(config._id, results[0]._id) # check no results for some other domain no_results = dbaccessors.by_domain(uuid.uuid4().hex) self.assertEqual(0, len(no_results))
def page_context(self): return { 'performance_configs': dbaccessors.by_domain(self.domain), }
def list_performance_configs(request, domain): return render(request, "performance_sms/list_performance_configs.html", { 'domain': domain, 'performance_configs': dbaccessors.by_domain(domain) })