def setUp(self): for idx in range(1, 4): target = ManyToManyTarget(name='target-%d' % idx) target.save() source = ManyToManySource(name='source-%d' % idx) source.save() for target in ManyToManyTarget.objects.all(): source.targets.add(target)