我有一个功能:
from django.contrib.gis.measure import Distance, D
def RunLengthCalc(mod_ewdim, mod_ewspacing, cols):
y = D(inch=mod_ewspacing) # user input
x = D(inch=mod_ewdim) # user input
z = D(inch=3) # constant
lrun = ((x * cols) + (y * (cols - 1))) + zrun
return lrun
和我的测试:
def test_run_length_calculation(self):
l = RunLengthCalc(26.5, 1, 25)
self.assertEquals(l, D(inch=689.5))
但是当我运行测试时,我得到了这个非常混乱的错误:
AssertionError: Distance(inch=689.5) != Distance(inch=689.5)
我无法弄清楚这里有什么问题。
任何帮助将非常感激。