python 2.6 to 2.7 unittest longmessage change

I've spent a few hours to find that unittest.TestCase.longMessage is False in python 2.7 and True in 2.6 and 3.x making my tests fail. To fixit in need to check in my test for the value of longMessage in the TestCase instance.


message = 'status_code is %s'
if self.longMessage:
    message = 'False is not True : ' + message

Django

Passionate Django developer with 5 years of experience on web sites and API's.

Bike

What else? Yachts are also a great but they don't fit well in cities.

FLOSS

Code is knowled. Knowled should be shared.