Re: FactoryBoy & ManyToManyField

2012-11-20 Thread Andres Reyes Monge
The simplest would be to class ATestCase(TestCase): def setUp(self): super(ATestCase, self).setUp() self.user = UserFactory() self.workplace = WorkplaceFactory() self.workplace.employees_set.add(self.user) def test_foobar(self): # how do I add sel

FactoryBoy & ManyToManyField

2012-11-20 Thread Craig Blaszczyk
Hi Guys, I'm using FactoryBoy in my tests, but I have a model which has a ManyToManyField to another model. Does anyone know if it's possible to make factoryboy use a factory to represent this relationship? For reference, here are a sample model and factory: --models.py from django.contrib.aut