本文整理汇总了Python中autonomie.models.company.Company.__name__方法的典型用法代码示例。如果您正苦于以下问题:Python Company.__name__方法的具体用法?Python Company.__name__怎么用?Python Company.__name__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autonomie.models.company.Company
的用法示例。
在下文中一共展示了Company.__name__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unique_ccode
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import __name__ [as 别名]
def test_unique_ccode(dbsession, content):
# A IMDD exists in the database for the company with id 1
company = Company.query().first()
company.__name__ = 'company'
validator = makeOne(company)
with pytest.raises(colander.Invalid):
validator('nutt', u'C001')
validator('nutt', u'C002')
company = Company(
name="company2",
goal="Company of user2",
phone='0457858586',
)
company.__name__ = 'company'
validator = makeOne(company)
validator('nutt', u'C001')
# In edit mode, no error is raised for the current_customer
customer = dbsession.query(Customer).first()
customer.__name__ = 'customer'
validator = makeOne(customer)
validator('nutt', u'C001')