当前位置: 首页>>代码示例>>Python>>正文


Python UserApi.create_minimal_user方法代码示例

本文整理汇总了Python中tracim_backend.lib.core.user.UserApi.create_minimal_user方法的典型用法代码示例。如果您正苦于以下问题:Python UserApi.create_minimal_user方法的具体用法?Python UserApi.create_minimal_user怎么用?Python UserApi.create_minimal_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tracim_backend.lib.core.user.UserApi的用法示例。


在下文中一共展示了UserApi.create_minimal_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_unit__create_minimal_user__err__too_short_email

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__create_minimal_user__err__too_short_email(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     with pytest.raises(TracimValidationFailed):
         u = api.create_minimal_user('[email protected]')
开发者ID:tracim,项目名称:tracim,代码行数:10,代码来源:test_user_api.py

示例2: test_unit__create_minimal_user_and_update__err__set_unaivalable_auth_type

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__create_minimal_user_and_update__err__set_unaivalable_auth_type(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     with pytest.raises(UserAuthTypeDisabled):
         api.update(u, name='bob', email='[email protected]', auth_type=AuthType.LDAP, do_save=True)
开发者ID:tracim,项目名称:tracim,代码行数:11,代码来源:test_user_api.py

示例3: test_unit__create_minimal_user__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__create_minimal_user__ok__nominal_case(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     assert u.email == '[email protected]'
     assert u.display_name == 'bob'
开发者ID:tracim,项目名称:tracim,代码行数:11,代码来源:test_user_api.py

示例4: test_unit__create_minimal_user__err__too_long_email

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__create_minimal_user__err__too_long_email(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     with pytest.raises(TracimValidationFailed):
         email = 'b{}[email protected]'.format('o'*255)
         u = api.create_minimal_user(email)
开发者ID:tracim,项目名称:tracim,代码行数:11,代码来源:test_user_api.py

示例5: test_unit__update_timezone__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_timezone__ok__nominal_case(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     assert u.timezone is None
     u = api.update(user=u, timezone='Europe/Paris')
     assert u.timezone == 'Europe/Paris'
开发者ID:tracim,项目名称:tracim,代码行数:12,代码来源:test_user_api.py

示例6: test_unit__update_user_email__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_user_email__ok__nominal_case(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     assert u.email == '[email protected]'
     u = api.update(user=u, email='[email protected]')
     assert u.email == '[email protected]'
开发者ID:tracim,项目名称:tracim,代码行数:12,代码来源:test_user_api.py

示例7: test_unit__get_one__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__get_one__ok__nominal_case(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     api.update(u, 'titi', '[email protected]', 'password', do_save=True)
     one = api.get_one(u.user_id)
     eq_(u.user_id, one.user_id)
开发者ID:tracim,项目名称:tracim,代码行数:12,代码来源:test_user_api.py

示例8: test_unit__get_all__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
    def test_unit__get_all__ok__nominal_case(self):
        api = UserApi(
            current_user=None,
            session=self.session,
            config=self.app_config,
        )
        u1 = api.create_minimal_user('[email protected]')

        users = api.get_all()
        # u1 + Admin user from BaseFixture
        assert 2 == len(users)
开发者ID:tracim,项目名称:tracim,代码行数:13,代码来源:test_user_api.py

示例9: test_unit__update_user_email__err__wrong_format

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
    def test_unit__update_user_email__err__wrong_format(self):
        api = UserApi(
            current_user=None,
            session=self.session,
            config=self.app_config,
        )
        u = api.create_minimal_user('[email protected]')

        # 2 char
        with pytest.raises(EmailValidationFailed):
            u = api.update(user=u, email='b+b')
开发者ID:tracim,项目名称:tracim,代码行数:13,代码来源:test_user_api.py

示例10: test_unit__update_user_public_name__err__too_long_password

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_user_public_name__err__too_long_password(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     with pytest.raises(TracimValidationFailed):
         name = 'n' * 256
         u = api.update(user=u, name=name)
     name = 'n' * 255
     u = api.update(user=u, name=name)
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py

示例11: test_unit__update_user_password__err__too_long_password

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_user_password__err__too_long_password(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     with pytest.raises(TracimValidationFailed):
         password = 'p' * 513
         u = api.update(user=u, password=password)
     password = 'p' * 512
     u = api.update(user=u, password=password)
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py

示例12: test_unit__update_user_password__err__too_short_password

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_user_password__err__too_short_password(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     # 5 char
     with pytest.raises(TracimValidationFailed):
         u = api.update(user=u, password='passw')
     # 6 char
     u = api.update(user=u, password='passwo')
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py

示例13: test_unit__update_user_lang__err__too_long_lang

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_user_lang__err__too_long_lang(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     with pytest.raises(TracimValidationFailed):
         lang = 'n' * 4
         u = api.update(user=u, lang=lang)
     lang = 'n' * 3
     u = api.update(user=u, lang=lang)
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py

示例14: test_unit__update_timezone__too_long_timezone

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
 def test_unit__update_timezone__too_long_timezone(self):
     api = UserApi(
         current_user=None,
         session=self.session,
         config=self.app_config,
     )
     u = api.create_minimal_user('[email protected]')
     with pytest.raises(TracimValidationFailed):
         timezone = 't' * 33
         u = api.update(user=u, timezone=timezone)
     timezone = 't' * 32
     u = api.update(user=u, timezone=timezone)
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py

示例15: test_unit__user_with_email_exists__ok__nominal_case

# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import create_minimal_user [as 别名]
    def test_unit__user_with_email_exists__ok__nominal_case(self):
        api = UserApi(
            current_user=None,
            session=self.session,
            config=self.app_config,
        )
        u = api.create_minimal_user('[email protected]')
        api.update(u, 'bibi', '[email protected]', 'password', do_save=True)
        transaction.commit()

        eq_(True, api.user_with_email_exists('[email protected]'))
        eq_(False, api.user_with_email_exists('unknown'))
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_user_api.py


注:本文中的tracim_backend.lib.core.user.UserApi.create_minimal_user方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。