@pytest.mark.django_db
def test_coop_create(self):
    ' Test customer model '
    coop_from_factory = CoopFactory()
    self.assertIsNotNone(coop_from_factory)
    coop = Coop.objects.create(name='test')
    coop.addresses.set(coop_from_factory.addresses.all())
    self.assertIsNotNone(coop)
Test customer model
@pytest.mark.django_db
def test_coop_create(self):
    '  '
    coop_from_factory = CoopFactory()
    self.assertIsNotNone(coop_from_factory)
    coop = Coop.objects.create(name='test')
    coop.addresses.set(coop_from_factory.addresses.all())
    self.assertIsNotNone(coop)