def test_clone_without_full(self):
     """Cloning should remove certain fields."""
     filter = ContactsFilter(tags=['C'],
                             locations=CompositeAndFilter({
                                 'city':
                                 MatchFilter('A'),
                                 'state':
                                 MatchFilter('B')
                             }))
     expected_with_city = ContactsFilter(tags=['C'],
                                         locations=CompositeAndFilter(
                                             {'city': MatchFilter('A')}))
     expected_with_state = ContactsFilter(tags=['C'],
                                          locations=CompositeAndFilter(
                                              {'state': MatchFilter('B')}))
     self.assertEqual(expected_with_state, filter.clone_without_city())
     self.assertEqual(expected_with_city, filter.clone_without_state())
 def test_clone_without_full(self):
     """Cloning should remove certain fields."""
     filter = ContactsFilter(
             tags=['C'],
             locations=CompositeAndFilter({
                 'city': MatchFilter('A'),
                 'state': MatchFilter('B')}))
     expected_with_city = ContactsFilter(
             tags=['C'],
             locations=CompositeAndFilter({
                 'city': MatchFilter('A')}))
     expected_with_state = ContactsFilter(
             tags=['C'],
             locations=CompositeAndFilter({
                 'state': MatchFilter('B')}))
     self.assertEqual(expected_with_state, filter.clone_without_city())
     self.assertEqual(expected_with_city, filter.clone_without_state())
 def test_clone_without_empty(self):
     """Cloning empty filters shouldn't crash."""
     filter = ContactsFilter()
     self.assertEqual(ContactsFilter(), filter.clone_without_city())
     self.assertEqual(ContactsFilter(), filter.clone_without_state())
 def test_clone_without_empty(self):
     """Cloning empty filters shouldn't crash."""
     filter = ContactsFilter()
     self.assertEqual(ContactsFilter(), filter.clone_without_city())
     self.assertEqual(ContactsFilter(), filter.clone_without_state())