title: How to compare Django Querysets
body: <p>I have been struggling all morning trying to figure out how to compare two different querysets.  I have two manytomanyfields in my model, and I'm trying to figure out if they are identical.  </p>
  
  <p>I research this by viewing this particular issue: <a href="https://stackoverflow.com/questions/17685023/how-do-i-test-django-querysets-are-equal">How do I test Django QuerySets are equal?</a></p>
  
  <p>I am using class based views...and I have a model with two manytomanyfields...</p>
  
  <p>My model...</p>
  
  <pre><code>class Author(models.Model):
  
  title = models.ManyToManyField(User,blank=True,related_name='title')
  title1 = models.ManyToManyField(User,blank=True,related_name='title1)
  </code></pre>
  
  <p>My View...</p>
  
  <pre><code>class AuthorDetailView(DetailView):
      model = Author 
  
  def get_context_data(self, **kwargs):
      context = super(AuthorDetailView, self).get_context_data(**kwargs)
      title = list(Author.objects.filter(title))
      title1 = list(Author.objects.filter(title1))
      test_instance = Author.objects.all()
      proxy4 = self.assertQuerySetEqual(Author.objects.all(), map(repr, [test_instance]))
  </code></pre>
  
  <p>I am trying to compare fields title and title1.  However when try to run the code above I continually get a 'View' object has no attribute 'assertQuerysetEqual'.  I can't even get this function to work.  I running Django 1.11 and Postgresql.  Perhaps this function doesn't work with Postgresql?  Any help to get me on the right track is appreciated.  Been playing with this and researching all morning with no luck.  Thanks in advance.</p>
  
  <p>Update...I have also been playing with various versions of trying to compare title_set.all and title1_set.all in the views....this is working intermittently...but the two are always returning that they are equal.  </p>