本文整理汇总了Python中models.Account.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Account.delete方法的具体用法?Python Account.delete怎么用?Python Account.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Account
的用法示例。
在下文中一共展示了Account.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_model_account
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import delete [as 别名]
def test_model_account(self):
"Test account model"
contact_type = ContactType(name='test')
contact_type.save()
contact = Contact(name='test', contact_type=contact_type)
contact.save()
currency = Currency(code="GBP",
name="Pounds",
symbol="L",
is_default=True)
currency.save()
obj = Account(name='test', owner=contact,
balance_currency=currency)
obj.save()
self.assertEquals('test', obj.name)
self.assertNotEquals(obj.id, None)
obj.delete()
示例2: test_parse_account
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import delete [as 别名]
def test_parse_account(self):
response = '''
{"response":[{"account_id":"1600001217","account_status":1,"access_role":"admin"}]}
'''
instance = Account()
instance.parse(json.loads(response)['response'][0])
instance.save()
self.assertEqual(instance.remote_id, 1600001217)
self.assertEqual(instance.account_status, True)
self.assertEqual(instance.access_role, 'admin')
instance.delete()
response = '''
{"response":[{"account_id":"1600001217","account_status":0,"access_role":"admin"}]}
'''
instance = Account()
instance.parse(json.loads(response)['response'][0])
instance.save()
self.assertEqual(instance.account_status, False)