Skip to content

Commit

Permalink
failing test - AttributeError: Cannot set values on a ManyToManyField…
Browse files Browse the repository at this point in the history
… which specifies an intermediary model.
  • Loading branch information
skyl committed Aug 26, 2013
1 parent 2e559e2 commit 6b4064e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/django_app/models.py
Expand Up @@ -107,3 +107,17 @@ class Tag(models.Model):
title = models.CharField(max_length=20)
customer = models.ForeignKey(Customer, blank=True, null=True)
messages = models.ManyToManyField(Message, null=True, blank=True)


class PointB(models.Model):
pass


class PointA(models.Model):
other = models.ManyToManyField("django_app.PointB",
through="django_app.Through")


class Through(models.Model):
pointas = models.ForeignKey(PointA)
pointbs = models.ForeignKey(PointB)
4 changes: 4 additions & 0 deletions tests/test_django.py
Expand Up @@ -108,6 +108,10 @@ def test_relation(self):
tag = mixer.blend('django_app.tag', customer=mixer.random)
self.assertTrue(tag.customer)

def test_many_to_many_through(self):
mixer = Mixer()
mixer.blend('django_app.pointa')

def test_default_mixer(self):
from mixer.backend.django import mixer

Expand Down

0 comments on commit 6b4064e

Please sign in to comment.