本文整理汇总了Python中the_tale.accounts.clans.prototypes.ClanPrototype.create方法的典型用法代码示例。如果您正苦于以下问题:Python ClanPrototype.create方法的具体用法?Python ClanPrototype.create怎么用?Python ClanPrototype.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.accounts.clans.prototypes.ClanPrototype
的用法示例。
在下文中一共展示了ClanPrototype.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def __init__(self):
register_user('forum_user', '[email protected]', '111111')
register_user('forum_user_2', '[email protected]', '111111')
self.account_1 = AccountPrototype.get_by_nick('forum_user')
self.account_2 = AccountPrototype.get_by_nick('forum_user_2')
# cat1
# |-subcat1
# | |-thread1
# | | |-post1
# | |-thread2
# |-subcat2
# cat2
# | subcat3
# | |- thread3
# cat3
self.cat_1 = CategoryPrototype.create(caption='cat1-caption', slug='cat1-slug', order=0)
# to test, that subcat.id not correlate with order
self.subcat_2 = SubCategoryPrototype.create(category=self.cat_1, caption='subcat2-caption', order=1, closed=True)
self.subcat_1 = SubCategoryPrototype.create(category=self.cat_1, caption='subcat1-caption', order=0)
self.cat_2 = CategoryPrototype.create(caption='cat2-caption', slug='cat2-slug', order=0)
self.subcat_3 = SubCategoryPrototype.create(category=self.cat_2, caption='subcat3-caption', order=0)
self.cat_3 = CategoryPrototype.create(caption='cat3-caption', slug='cat3-slug', order=0)
self.thread_1 = ThreadPrototype.create(self.subcat_1, 'thread1-caption', self.account_1, 'thread1-text')
self.thread_2 = ThreadPrototype.create(self.subcat_1, 'thread2-caption', self.account_1, 'thread2-text')
self.thread_3 = ThreadPrototype.create(self.subcat_3, 'thread3-caption', self.account_1, 'thread3-text')
self.post_1 = PostPrototype.create(self.thread_1, self.account_1, 'post1-text')
# create test clan and clean it's forum artifacts
self.clan_category = CategoryPrototype.create(caption='category-1', slug=clans_settings.FORUM_CATEGORY_SLUG, order=0)
self.clan_1 = ClanPrototype.create(self.account_1, abbr=u'abbr1', name=u'name1', motto=u'motto', description=u'description')
示例2: setUp
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def setUp(self):
super(ClanPrototypeTransactionTests, self).setUp()
create_test_map()
self.forum_category = CategoryPrototype.create(caption='category-1', slug=clans_settings.FORUM_CATEGORY_SLUG, order=0)
result, account_id, bundle_id = register_user('test_user', '[email protected]', '111111')
self.account = AccountPrototype.get_by_id(account_id)
self.clan = ClanPrototype.create(self.account, abbr=u'abbr', name=u'clan-name', motto='clan-motto', description=u'clan-description')
示例3: setUp
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def setUp(self):
super(AccountRequestsTests, self).setUp()
self.place1, self.place2, self.place3 = create_test_map()
result, account_id, bundle_id = logic.register_user('test_user1', '[email protected]', '111111')
self.account_1 = AccountPrototype.get_by_id(account_id)
result, account_id, bundle_id = logic.register_user('test_user2', '[email protected]', '111111')
self.account_2 = AccountPrototype.get_by_id(account_id)
result, account_id, bundle_id = logic.register_user('test_user3', '[email protected]', '111111')
self.account_3 = AccountPrototype.get_by_id(account_id)
result, account_id, bundle_id = logic.register_user('test_user_bot', '[email protected]', '111111', is_bot=True)
self.account_bot = AccountPrototype.get_by_id(account_id)
result, account_id, bundle_id = logic.register_user('test_user4')
self.account_4 = AccountPrototype.get_by_id(account_id)
CategoryPrototype.create(caption='category-1', slug=clans_settings.FORUM_CATEGORY_SLUG, order=0)
self.clan_2 = ClanPrototype.create(self.account_2, abbr=u'abbr2', name=u'name2', motto=u'motto', description=u'description')
self.clan_3 = ClanPrototype.create(self.account_3, abbr=u'abbr3', name=u'name3', motto=u'motto', description=u'description')
示例4: setUp
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def setUp(self):
super(BaseTestRequests, self).setUp()
self.place1, self.place2, self.place3 = create_test_map()
self.account_1 = self.accounts_factory.create_account()
self.account_2 = self.accounts_factory.create_account()
self.client = client.Client()
helpers.prepair_forum()
CategoryPrototype.create(caption="category-1", slug=clans_settings.FORUM_CATEGORY_SLUG, order=0)
self.clan_2 = ClanPrototype.create(
self.account_2, abbr="abbr2", name="name2", motto="motto", description="description"
)
示例5: setUp
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def setUp(self):
super(BaseTestRequests, self).setUp()
self.place1, self.place2, self.place3 = create_test_map()
result, account_id, bundle_id = register_user('test_user_1', '[email protected]', '111111')
self.account_1 = AccountPrototype.get_by_id(account_id)
result, account_id, bundle_id = register_user('test_user_2', '[email protected]', '111111')
self.account_2 = AccountPrototype.get_by_id(account_id)
self.client = client.Client()
helpers.prepair_forum()
CategoryPrototype.create(caption='category-1', slug=clans_settings.FORUM_CATEGORY_SLUG, order=0)
self.clan_2 = ClanPrototype.create(self.account_2, abbr=u'abbr2', name=u'name2', motto=u'motto', description=u'description')
示例6: test_create_remove_multiple_clans
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def test_create_remove_multiple_clans(self):
result, account_id, bundle_id = register_user('test_user_2', '[email protected]', '111111')
account_2 = AccountPrototype.get_by_id(account_id)
clan_2 = ClanPrototype.create(account_2, abbr=u'abbr2', name=u'clan-name-2', motto='clan-2-motto', description=u'clan-2-description')
self.assertEqual(SubCategoryPrototype._db_count(), 2)
self.assertEqual(ForumPermissionPrototype._db_count(), 2)
self.assertNotEqual(ForumPermissionPrototype.get_for(self.account.id, self.clan.forum_subcategory_id), None)
self.assertNotEqual(ForumPermissionPrototype.get_for(account_2.id, clan_2.forum_subcategory_id), None)
clan_2.remove()
self.assertEqual(SubCategoryPrototype._db_count(), 2)
self.assertEqual(ForumPermissionPrototype._db_count(), 1)
self.assertNotEqual(ForumPermissionPrototype.get_for(self.account.id, self.clan.forum_subcategory_id), None)
self.assertEqual(ForumPermissionPrototype.get_for(account_2.id, clan_2.forum_subcategory_id), None)
示例7: create_clan
# 需要导入模块: from the_tale.accounts.clans.prototypes import ClanPrototype [as 别名]
# 或者: from the_tale.accounts.clans.prototypes.ClanPrototype import create [as 别名]
def create_clan(self, owner, i):
return ClanPrototype.create(owner=owner,
abbr=u'a-%d' % i,
name=u'name-%d' % i,
motto=u'motto-%d' %i ,
description=u'[b]description-%d[/b]' % i)