Exemplo n.º 1
0
 def test_location(self):
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.id = 12345
     site_map = AllocationsSitemap()
     actual_location = site_map.location(request0)
     expected_location = '/allocations/applications/12345/approved'
     self.assertEquals(expected_location, actual_location)
Exemplo n.º 2
0
 def test_lastmod(self):
     expected_datetime = datetime(2014, 10, 13)
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.modified_time = expected_datetime
     site_map = AllocationsSitemap()
     actual_modification_datetime = site_map.lastmod(request0)
     self.assertEquals(expected_datetime, actual_modification_datetime)
Exemplo n.º 3
0
 def test_location(self):
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.id = 12345
     site_map = AllocationsSitemap()
     actual_location = site_map.location(request0)
     expected_location = '/allocations/applications/12345/approved'
     self.assertEquals(expected_location, actual_location)
Exemplo n.º 4
0
 def test_lastmod(self):
     expected_datetime = datetime(2014, 10, 13)
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.modified_time = expected_datetime
     site_map = AllocationsSitemap()
     actual_modification_datetime = site_map.lastmod(request0)
     self.assertEquals(expected_datetime, actual_modification_datetime)
Exemplo n.º 5
0
    def test_items(self, mock_find_active_allocations):
        request0 = AllocationRequest(project_name="Project X", status="E")
        request1 = AllocationRequest(project_name="Project Y", status="X")
        expected_items = [request0, request1]

        mock_find_active_allocations.return_value = expected_items
        site_map = AllocationsSitemap()
        actual_items = site_map.items()
        self.assertListEqual(expected_items, actual_items)
Exemplo n.º 6
0
    def test_items(self, mock_find_active_allocations):
        request0 = AllocationRequest(project_name="Project X", status="E")
        request1 = AllocationRequest(project_name="Project Y", status="X")
        expected_items = [request0, request1]

        mock_find_active_allocations.return_value = expected_items
        site_map = AllocationsSitemap()
        actual_items = site_map.items()
        self.assertListEqual(expected_items, actual_items)