def test_lookup_with_dynamic_value(self):
        modeladmin = DepartmentFilterDynamicValueBookAdmin(Book, site)

        def _test_choices(request, expected_displays):
            changelist = self.get_changelist(request, Book, modeladmin)
            filterspec = changelist.get_filters(request)[0][0]
            self.assertEqual(force_text(filterspec.title), 'publication decade')
            choices = tuple(c['display'] for c in filterspec.choices(changelist))
            self.assertEqual(choices, expected_displays)

        _test_choices(self.request_factory.get('/', {}),
                      ("All", "the 1980's", "the 1990's"))

        _test_choices(self.request_factory.get('/', {'publication-decade': 'the 80s'}),
                      ("All", "the 1990's"))

        _test_choices(self.request_factory.get('/', {'publication-decade': 'the 90s'}),
                      ("All", "the 1980's"))
Ensure SimpleListFilter can access self.value() inside the lookup.
dataset/ETHPy150Open django/django/tests/admin_filters/tests.py/ListFiltersTests.test_lookup_with_dynamic_value