summaryrefslogtreecommitdiffstats
path: root/askbot/management
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-07-10 13:45:55 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-07-10 13:45:55 -0400
commitdebd28158d0419d9ae3022cad765d614b64c543b (patch)
treeefc0c24925505dc569e25ac917552eaf9fb15bdd /askbot/management
parent91e111f41d33f065f6e37e78ed6a1e1b3da4190e (diff)
downloadaskbot-debd28158d0419d9ae3022cad765d614b64c543b.tar.gz
askbot-debd28158d0419d9ae3022cad765d614b64c543b.tar.bz2
askbot-debd28158d0419d9ae3022cad765d614b64c543b.zip
fixed style for the multiline question titles in the related question box on the ask page
Diffstat (limited to 'askbot/management')
-rw-r--r--askbot/management/commands/askbot_add_test_content.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/askbot/management/commands/askbot_add_test_content.py b/askbot/management/commands/askbot_add_test_content.py
index ace629d0..ca250339 100644
--- a/askbot/management/commands/askbot_add_test_content.py
+++ b/askbot/management/commands/askbot_add_test_content.py
@@ -20,7 +20,8 @@ BAD_STUFF = "<script>alert('hohoho')</script>"
USERNAME_TEMPLATE = BAD_STUFF + "test_user_%s"
PASSWORD_TEMPLATE = "test_password_%s"
EMAIL_TEMPLATE = "test_user_%s@askbot.org"
-TITLE_TEMPLATE = "Test question title No.%s" + BAD_STUFF
+TITLE_TEMPLATE = "Question No.%s" + BAD_STUFF
+LONG_TITLE_TEMPLATE = TITLE_TEMPLATE + 'a lot more text a lot more text a lot more text '*5
TAGS_TEMPLATE = [BAD_STUFF + "tag-%s-0", BAD_STUFF + "tag-%s-1"] # len(TAGS_TEMPLATE) tags per question
CONTENT_TEMPLATE = BAD_STUFF + """Lorem lean startup ipsum product market fit customer
@@ -99,11 +100,18 @@ class Command(NoArgsCommand):
tags = " ".join([t%user.id for t in TAGS_TEMPLATE])
if i < NUM_QUESTIONS/2:
tags += ' one-tag'
+
+ if i % 2 == 0:
+ question_template = TITLE_TEMPLATE
+ else:
+ question_template = LONG_TITLE_TEMPLATE
+
active_question = user.post_question(
- title = TITLE_TEMPLATE % user.id,
+ title = question_template % user.id,
body_text = CONTENT_TEMPLATE,
tags = tags,
)
+
self.print_if_verbose("Created Question '%s' with tags: '%s'" % (
active_question.thread.title, tags,)
)