def test_applications_are_listed_by_domain(self): domain = fixtures.get_domain(name='foo') owner = get_user('us-ignite') app_a = fixtures.get_application( name='alpha app', status=Application.PUBLISHED, owner=owner, domain=domain) fixtures.get_application( name='beta app', status=Application.PUBLISHED, owner=owner) response = views.app_list(self.factory.get('/app/foo/'), 'foo') eq_(response.status_code, 200) eq_(response.template_name, 'apps/object_list.html') eq_(list(response.context_data['page'].object_list), [app_a]) _teardown_apps()
def test_domain_url(self): user = get_user('app-owner') domain = fixtures.get_domain(slug='healthcare') application = fixtures.get_application(owner=user, domain=domain) eq_(application.get_domain_url(), u'/apps/domain/healthcare/')