def testAddition(self):
        "Test addition & subtraction"
        d1 = D(m=100)
        d2 = D(m=200)

        d3 = d1 + d2
        self.assertEqual(d3.m, 300)
        d3 += d1
        self.assertEqual(d3.m, 400)
        
        d4 = d1 - d2
        self.assertEqual(d4.m, -100)
        d4 -= d1
        self.assertEqual(d4.m, -200)
        
        try:
            d5 = d1 + 1
        except TypeError, e:
            pass
        else:
            self.fail('Distance + number should raise TypeError')

        try:
            d5 = d1 - 1
        except TypeError, e:
            pass
        else:
            self.fail('Distance - number should raise TypeError')

        try:
            d1 += 1
        except TypeError, e:
            pass
        else:
            self.fail('Distance += number should raise TypeError')

        try:
            d1 -= 1
        except TypeError, e:
            pass
        else:
            self.fail('Distance -= number should raise TypeError')
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/contrib/gis/tests/test_measure.py/DistanceTest.testAddition/original