def test_float_field_to_xml(self): from wechatpy.fields import FloatField name = 'Content' value = 0.0 expected = '<{name}>{value}</{name}>'.format(name=name, value=value) field = FloatField(name) self.assertEqual(expected, field.to_xml(value))
def test_float_field_to_xml(self): from wechatpy.fields import FloatField name = "Content" value = 0.0 expected = "<{name}>{value}</{name}>".format(name=name, value=value) field = FloatField(name) self.assertEqual(expected, field.to_xml(value))
def test_float_field_to_xml(self): from wechatpy.fields import FloatField name = "Content" value = 0.0 expected = f"<{name}>{value}</{name}>" field = FloatField(name) self.assertEqual(expected, field.to_xml(value))
class LocationEvent(BaseEvent): """ 上报地理位置事件 详情请参阅 http://mp.weixin.qq.com/wiki/2/5baf56ce4947d35003b86a9805634b1e.html """ event = 'location' latitude = FloatField('Latitude', 0.0) longitude = FloatField('Longitude', 0.0) precision = FloatField('Precision', 0.0)
class LocationEvent(BaseEvent): """ 上报地理位置事件 详情请参阅 https://mp.weixin.qq.com/wiki?id=mp1421140454 """ event = 'location' latitude = FloatField('Latitude', 0.0) longitude = FloatField('Longitude', 0.0) precision = FloatField('Precision', 0.0)
class LocationEvent(BaseEvent): """ 上报地理位置事件 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html """ event = "location" latitude = FloatField("Latitude", 0.0) longitude = FloatField("Longitude", 0.0) precision = FloatField("Precision", 0.0)
class LocationEvent(BaseEvent): """ 上报地理位置事件 详情请参阅 https://work.weixin.qq.com/api/doc/90000/90135/90240#%E4%B8%8A%E6%8A%A5%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE """ agent = IntegerField("AgentID", 0) latitude = FloatField("Latitude", 0.0) longitude = FloatField("Longitude", 0.0) precision = FloatField("Precision", 0.0) event = "location"