'GET /domains?enabled=0.
Test Plan:
- Update policy for no protection on api
- Filter by the \'enabled\' boolean to get disabled domains, which
should return just domainC
- Try the filter using different ways of specifying True/False
to test that our handling of booleans in filter matching is
correct'

def test_list_filtered_domains(self):

    new_policy = {'identity:list_domains': []}
    self._set_policy(new_policy)
    r = self.get('/domains?enabled=0', auth=self.auth)
    id_list = self._get_id_list_from_ref_list(r.result.get('domains'))
    self.assertEqual(1, len(id_list))
    self.assertIn(self.domainC['id'], id_list)
    for val in ('0', 'false', 'False', 'FALSE', 'n', 'no', 'off'):
        r = self.get(('/domains?enabled=%s' % val), auth=self.auth)
        id_list = self._get_id_list_from_ref_list(r.result.get('domains'))
        self.assertEqual([self.domainC['id']], id_list)
    for val in ('1', 'true', 'True', 'TRUE', 'y', 'yes', 'on'):
        r = self.get(('/domains?enabled=%s' % val), auth=self.auth)
        id_list = self._get_id_list_from_ref_list(r.result.get('domains'))
        self.assertEqual(3, len(id_list))
        self.assertIn(self.domainA['id'], id_list)
        self.assertIn(self.domainB['id'], id_list)
        self.assertIn(CONF.identity.default_domain_id, id_list)
    r = self.get('/domains?enabled', auth=self.auth)
    id_list = self._get_id_list_from_ref_list(r.result.get('domains'))
    self.assertEqual(3, len(id_list))
    self.assertIn(self.domainA['id'], id_list)
    self.assertIn(self.domainB['id'], id_list)
    self.assertIn(CONF.identity.default_domain_id, id_list)
