'Test for https://code.djangoproject.com/ticket/16818'

def test_manyrelated_add_commit(self):

    a = M2mA.objects.create()
    b = M2mB.objects.create(fld=10)
    a.others.add(b)
    transaction.rollback()
    self.assertEqual(a.others.count(), 1)
