def test_organization3(self): # Test if person name is on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/organization/whorgn') response = organizations(request, 'whorgn') htmlstring = response.content self.assertNotEqual(htmlstring.find('<h1 class="main-focus">World Health Organization</h1>'),-1)
def test_organization2(self): # Test if person kind is on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/organization/whorgn') response = organizations(request, 'whorgn') htmlstring = response.content self.assertNotEqual(htmlstring.find('<li>Public Health</li>'),-1)
def test_organization4(self): # Test if related objects are on page in format designated in template request_factory = RequestFactory() request = request_factory.get('/crisix/organization/whorgn') response = organizations(request, 'whorgn') 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/people/brobma/">Barack Obama</a></li>'),-1)
def test_organization1(self): # Test if the instance page is accessible request_factory = RequestFactory() request = request_factory.get('/crisix/organization/whorgn') response = organizations(request, 'whorgn') self.assertEqual(response.status_code, 200)