

def test_m2m_add_remove_suggestion(self):
    self.assertEqual(self.committee.members.count(), 0)
    suggestion1 = Suggestion.objects.create_suggestion(suggested_by=self.regular_user, actions=[{
        'subject': self.committee,
        'action': consts.ADD,
        'fields': {
            'members': suggestion2.member1,
        },
    }])
    suggestion2 = Suggestion.objects.create_suggestion(suggested_by=self.regular_user, actions=[{
        'subject': self.committee,
        'action': consts.ADD,
        'fields': {
            'members': self.member2,
        },
    }])
    suggestion3 = Suggestion.objects.create_suggestion(suggested_by=self.regular_user, actions=[{
        'subject': self.committee,
        'action': consts.REMOVE,
        'fields': {
            'members': self.member1,
        },
    }])
    suggestion1.auto_apply(self.editor)
    self.assertItemsEqual(self.committee.members.all(), [self.member1])
    suggestion2.auto_apply(self.editor)
    self.assertItemsEqual(self.committee.members.all(), [self.member1, self.member2])
    suggestion3.auto_apply(self.editor)
    self.assertItemsEqual(self.committee.members.all(), [self.member2])
    self.committee.members.clear()
    Suggestion.objects.all().delete()

dataset/ETHPy150Open ofri/Open-Knesset/suggestions/tests.py SuggestionsTests.test_m2m_add_remove_suggestion/VarMisuse@66/91 `self`->`suggestion2`