      def test_reverse_many_to_many_retrieve(self):
          queryset = ManyToManyTarget.objects.all()
          serializer = ManyToManyTargetSerializer(queryset)
          expected = [
              {'id': 1, 'name': u'target-1', 'sources': [1, 2, 3]},
              {'id': 2, 'name': u'target-2', 'sources': [2, 3]},
              {'id': 3, 'name': u'target-3', 'sources': [3]}
          ]
          self.assertEquals(serializer.data, expected)
  
      def test_many_to_many_update(self):
          data = {'id': 1, 'name': u'source-1', 'targets': [1, 2, 3]}
 
</s> remove             {'id': 1, 'name': u'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': u'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': u'target-3', 'sources': [3]},
            {'id': 4, 'name': u'target-4', 'sources': [1, 3]}
 </s> add             {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]},
            {'id': 4, 'name': 'target-4', 'sources': [1, 3]} </s> remove             {'id': 1, 'name': u'target-1', 'sources': [1]},
            {'id': 2, 'name': u'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': u'target-3', 'sources': [3]}
 </s> add             {'id': 1, 'name': 'target-1', 'sources': [1]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]} </s> remove             {'id': 1, 'name': u'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': u'target-2', 'sources': []},
 </s> add             {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': []}, </s> remove                 {'id': 1, 'name': u'source-1', 'targets': [1, 2, 3]},
                {'id': 2, 'name': u'source-2', 'targets': [1, 2]},
                {'id': 3, 'name': u'source-3', 'targets': [1, 2, 3]}
 </s> add                 {'id': 1, 'name': 'source-1', 'targets': [1, 2, 3]},
                {'id': 2, 'name': 'source-2', 'targets': [1, 2]},
                {'id': 3, 'name': 'source-3', 'targets': [1, 2, 3]} </s> remove                 {'id': 1, 'name': u'source-1', 'targets': [1]},
                {'id': 2, 'name': u'source-2', 'targets': [1, 2]},
                {'id': 3, 'name': u'source-3', 'targets': [1, 2, 3]}
 </s> add                 {'id': 1, 'name': 'source-1', 'targets': [1]},
                {'id': 2, 'name': 'source-2', 'targets': [1, 2]},
                {'id': 3, 'name': 'source-3', 'targets': [1, 2, 3]}
            {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]}
      def test_reverse_many_to_many_retrieve(self):
          queryset = ManyToManyTarget.objects.all()
          serializer = ManyToManyTargetSerializer(queryset)
          expected = [
            {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]}
            {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]}
            {'id': 1, 'name': 'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': 'target-2', 'sources': [2, 3]},
            {'id': 3, 'name': 'target-3', 'sources': [3]}
          ]
          self.assertEquals(serializer.data, expected)
  
      def test_many_to_many_update(self):
          data = {'id': 1, 'name': u'source-1', 'targets': [1, 2, 3]}
keep keep keep keep replace replace replace keep keep keep keep keep
 First passing test under p3k \o/ 
rest_framework/tests/pk_relations.py