本文整理汇总了Python中ziggurat_foundations.tests.conftest.User.by_email_and_username方法的典型用法代码示例。如果您正苦于以下问题:Python User.by_email_and_username方法的具体用法?Python User.by_email_and_username怎么用?Python User.by_email_and_username使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ziggurat_foundations.tests.conftest.User
的用法示例。
在下文中一共展示了User.by_email_and_username方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_by_mail_and_username_wrong_username
# 需要导入模块: from ziggurat_foundations.tests.conftest import User [as 别名]
# 或者: from ziggurat_foundations.tests.conftest.User import by_email_and_username [as 别名]
def test_by_mail_and_username_wrong_username(self, db_session):
add_user(db_session)
queried_user = User.by_email_and_username('email', 'wrong_username',
db_session=db_session)
assert queried_user is None
示例2: test_by_mail_and_username_none
# 需要导入模块: from ziggurat_foundations.tests.conftest import User [as 别名]
# 或者: from ziggurat_foundations.tests.conftest.User import by_email_and_username [as 别名]
def test_by_mail_and_username_none(self, db_session):
found = User.by_email_and_username('email', None,
db_session=db_session)
assert found is None
示例3: test_by_mail_and_username
# 需要导入模块: from ziggurat_foundations.tests.conftest import User [as 别名]
# 或者: from ziggurat_foundations.tests.conftest.User import by_email_and_username [as 别名]
def test_by_mail_and_username(self, db_session):
created_user = add_user(db_session)
queried_user = User.by_email_and_username('email', 'username',
db_session=db_session)
assert created_user == queried_user