'Compare the results of a raw query against expected results'

def assertProcessed(self, model, results, orig, expected_annotations=()):

    self.assertEqual(len(results), len(orig))
    for (index, item) in enumerate(results):
        orig_item = orig[index]
        for annotation in expected_annotations:
            setattr(orig_item, *annotation)
        for field in model._meta.fields:
            self.assertEquals(getattr(item, field.attname), getattr(orig_item, field.attname))
            self.assertEquals(type(getattr(item, field.attname)), type(getattr(orig_item, field.attname)))
