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
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
2 matches
Mail list logo