def last(self):
        qs = self.reverse() if self.ordered else self.order_by('-pk')
        try:
            return qs[0]
        except IndexError:
            return None
testing if the to_xml() method is working properly
dataset/ETHPy150Open ulule/django-courriers/courriers/core.py/QuerySet.last--crossover with--dataset/ETHPy150Open eoyilmaz/anima/tests/previs/test_rate.py/RateTestCase.test_to_xml_method_is_working_properly