

def test_merging_m2m_attributes(self):
    "Merging: ensure M2M-related fields are properly saved/combined.\n        This is a regression test; we have to ensure that M2M objects aren't\n        removed from the database."
    assertions = {
        'tags': set(Tag.objects.filter(name__in=['SWC'])),
    }
    self.strategy.update({
        'id': 'obj_a',
        'tags': 'obj_b',
    })
    rv = self.client.post(self.url, data=self.strategy)
    self.assertEqual(rv.status_code, 302)
    self.event_a.refresh_from_db()
    for (key, value) in rv.items():
        self.assertEqual(set(getattr(self.event_a, key).all()), value, key)

dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py TestEventMerging.test_merging_m2m_attributes/VarMisuse@103/200 `assertions`->`rv`