def test_people2(self): # Test if person kind is on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/people/brobma') response = people(request, 'brobma') htmlstring = response.content self.assertNotEqual(htmlstring.find('<li>President</li>'),-1)
def test_people3(self): # Test if person name is on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/people/brobma') response = people(request, 'brobma') htmlstring = response.content self.assertNotEqual(htmlstring.find('<h1 class="main-focus">Barack Obama</h1>'),-1)
def test_people4(self): # Test if related objects are on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/people/brobma') response = people(request, 'brobma') htmlstring = response.content self.assertNotEqual(htmlstring.find('<li><a href="/crisix/crises/haiear/">2010 Haiti Earthquake</a></li>'),-1) self.assertNotEqual(htmlstring.find('<li><a href="/crisix/organizations/whorgn/">World Health Organization</a></li>'),-1)
def test_people1(self): # Test if the instance page is accessible request_factory = RequestFactory() request = request_factory.get('/crisix/people/brobma') response = people(request, 'brobma') self.assertEqual(response.status_code, 200)