title: Django: assert 'Many-to-many' relation exists in test
body: <p>I am writing tests for my project, but I've run into a problem when trying to verify the existence of a 'ManyToMany' relationship. </p>
  
  <p>The test concerns the following two models, that are linked together with a ManyToMany</p>
  
  <p>Models:</p>
  
  <pre><code>class Project(models.Model):
      (...)
      linked_attributes = models.ManyToManyField(attributes, blank=True)
  
  
  class Attributes(models.Model):
      (...)
      class linked_projects = models.ManyToManyField(Project, blank=True)
  </code></pre>
  
  <p>In my test I wanted to verify that the form created a new many to many relationship. I created the assert on the last line, based on some example code, but it doesn't seem to be working. </p>
  
  <p>Test:</p>
  
  <pre><code>class ProjectTest(TestCase):
      (...)
      form_data = {'linked_attributes' : self.attribute}
      form = ProjectForm(data=form_data, project=self.project, instance=self.project)
  
     self.assertTrue(Project.attributes_set.filter(pk=self.Project.pk).exists())
  </code></pre>
  
  <p>Does anyone know what I am doing wrong?</p>