'Ensure that order_by and primary work.'

def test_order_works_with_primary(self):

    class Number(Document, ):
        n = IntField(primary_key=True)
    Number.drop_collection()
    Number(n=1).save()
    Number(n=2).save()
    Number(n=3).save()
    numbers = [n.n for n in Number.objects.order_by('-n')]
    self.assertEqual([3, 2, 1], numbers)
    numbers = [n.n for n in Number.objects.order_by('+n')]
    self.assertEqual([1, 2, 3], numbers)
    Number.drop_collection()
