Commit 88598897 authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: up

parent 422ba5a1
......@@ -4,38 +4,47 @@ post_per_thread_amount = 97
max_new_document = 100
tag = 'POPULATE_FORUM'
if (current_project_uid is None) and (created_project_count < project_count):
created_project_count += 1
created_thread_count = 0
created_post_count = 0
# no project, create
project = context.project_module.newContent(
portal_type='Project',
title='Forum project %i' % created_project_count,
activate_kw={'tag': tag}
)
return context.activate(after_tag=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
thread = context.discussion_thread_module.newContent(
portal_type='Discussion Thread',
title='Forum project %i discussion %i' % (created_project_count, created_thread_count),
follow_up_uid=current_project_uid,
activate_kw={'tag': tag}
)
thread.share()
return context.activate(after_tag=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
)
after_tag = tag + 'XXX'
if (current_project_uid is None):
if (created_project_count < project_count):
created_project_count += 1
created_thread_count = 0
created_post_count = 0
# no project, create
project = context.project_module.newContent(
portal_type='Project',
title='Forum project %i' % created_project_count,
activate_kw={'tag': tag}
)
return context.activate(after_tag=after_tag).testromain(
current_project_uid=project.getUid(),
created_project_count=created_project_count
)
else:
return 'stopping'
if (current_thread_path is None):
if (created_thread_count < thread_per_project_count):
created_thread_count += 1
thread = context.discussion_thread_module.newContent(
portal_type='Discussion Thread',
title='New Forum project %i discussion %i' % (created_project_count, created_thread_count),
follow_up_uid=current_project_uid,
activate_kw={'tag': tag}
)
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 (created_post_count < post_per_thread_amount):
......@@ -48,7 +57,7 @@ if (current_thread_path is not None):
activate_kw={'tag': tag}
)
# post.share()
return context.activate(after_tag=tag).testromain(
return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid,
current_thread_path=current_thread_path,
created_project_count=created_project_count,
......@@ -56,7 +65,7 @@ if (current_thread_path is not None):
created_post_count=created_post_count
)
else:
return context.activate(after_tag=tag).testromain(
return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid,
created_project_count=created_project_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