Commit 49665d94 authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: up

parent eaecab55
...@@ -4,38 +4,47 @@ post_per_thread_amount = 97 ...@@ -4,38 +4,47 @@ post_per_thread_amount = 97
max_new_document = 100 max_new_document = 100
tag = 'POPULATE_FORUM' tag = 'POPULATE_FORUM'
after_tag = tag + 'XXX'
if (current_project_uid is None) and (created_project_count < project_count):
created_project_count += 1 if (current_project_uid is None):
created_thread_count = 0 if (created_project_count < project_count):
created_post_count = 0 created_project_count += 1
# no project, create created_thread_count = 0
project = context.project_module.newContent( created_post_count = 0
portal_type='Project', # no project, create
title='Forum project %i' % created_project_count, project = context.project_module.newContent(
activate_kw={'tag': tag} portal_type='Project',
) title='Forum project %i' % created_project_count,
return context.activate(after_tag=tag).testromain( activate_kw={'tag': tag}
current_project_uid=project.getUid(), )
created_project_count=created_project_count return context.activate(after_tag=after_tag).testromain(
) current_project_uid=project.getUid(),
created_project_count=created_project_count
if (current_thread_path is None) and (created_thread_count < thread_per_project_count): )
created_thread_count += 1 else:
thread = context.discussion_thread_module.newContent( return 'stopping'
portal_type='Discussion Thread',
title='Forum project %i discussion %i' % (created_project_count, created_thread_count), if (current_thread_path is None):
follow_up_uid=current_project_uid, if (created_thread_count < thread_per_project_count):
activate_kw={'tag': tag} created_thread_count += 1
) thread = context.discussion_thread_module.newContent(
thread.share() portal_type='Discussion Thread',
return context.activate(after_tag=tag).testromain( title='New Forum project %i discussion %i' % (created_project_count, created_thread_count),
current_project_uid=current_project_uid, follow_up_uid=current_project_uid,
current_thread_path=thread.getRelativeUrl(), activate_kw={'tag': tag}
created_project_count=created_project_count, )
created_thread_count=created_thread_count thread.share()
) return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid,
current_thread_path=thread.getRelativeUrl(),
created_project_count=created_project_count,
created_thread_count=created_thread_count
)
else:
return context.activate(after_tag=after_tag).testromain(
created_project_count=created_project_count
)
if (current_thread_path is not None): if (current_thread_path is not None):
if (created_post_count < post_per_thread_amount): if (created_post_count < post_per_thread_amount):
...@@ -48,7 +57,7 @@ if (current_thread_path is not None): ...@@ -48,7 +57,7 @@ if (current_thread_path is not None):
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
# post.share() # post.share()
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid, current_project_uid=current_project_uid,
current_thread_path=current_thread_path, current_thread_path=current_thread_path,
created_project_count=created_project_count, created_project_count=created_project_count,
...@@ -56,7 +65,7 @@ if (current_thread_path is not None): ...@@ -56,7 +65,7 @@ if (current_thread_path is not None):
created_post_count=created_post_count created_post_count=created_post_count
) )
else: else:
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid, current_project_uid=current_project_uid,
created_project_count=created_project_count, created_project_count=created_project_count,
created_thread_count=created_thread_count created_thread_count=created_thread_count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment