def test_find_date_modified(self): request = self._make_req() request.headers[VERSION] = "11" doc = extract_doc(request, "mock") self.assertIn(VERSION, request.response.headers) self.assertEqual(request.response.headers[VERSION], "11") self.assertEqual(doc["dateModified"], mock_doc["revisions"][11]["date"]) request = self._make_req() request.headers[VERSION] = "2" doc = extract_doc(request, "mock") self.assertIn(VERSION, request.response.headers) self.assertEqual(request.response.headers[VERSION], "2") self.assertEqual(doc["dateModified"], mock_doc["revisions"][0]["date"])
def test_find_date_modified(self): request = self._make_req() request.headers[VERSION] = '11' doc = extract_doc(request, 'mock') self.assertIn(VERSION, request.response.headers) self.assertEqual(request.response.headers[VERSION], '11') self.assertEqual(doc['dateModified'], mock_doc['revisions'][11]['date']) request = self._make_req() request.headers[VERSION] = '2' doc = extract_doc(request, 'mock') self.assertIn(VERSION, request.response.headers) self.assertEqual(request.response.headers[VERSION], '2') self.assertEqual(doc['dateModified'], mock_doc['revisions'][1]['date'])