def test_get_previous_link_value(self, mock_super): """Test the get previous link method when super returns a value.""" expected = 'http://localhost:8000/api/v1/providers/?offset=20' mock_super.return_value = expected paginator = StandardResultsSetPagination() paginator.request = Mock paginator.request.META = {} link = paginator.get_previous_link() self.assertEqual(link, expected)
def test_get_previous_link_none(self, mock_super): """Test the get previous link method when super returns none.""" paginator = StandardResultsSetPagination() link = paginator.get_previous_link() self.assertIsNone(link)