diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-26 00:18:27 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-26 00:18:27 -0400 |
commit | ef5ed9c348b8659a156641de99b2a6bfac376d31 (patch) | |
tree | e21d91b6e2d40a3795f945a3d6a14a3f78094274 | |
parent | 1e1a8808500d07bb54f90a055f2fab8cf87ca87d (diff) | |
download | askbot-ef5ed9c348b8659a156641de99b2a6bfac376d31.tar.gz askbot-ef5ed9c348b8659a156641de99b2a6bfac376d31.tar.bz2 askbot-ef5ed9c348b8659a156641de99b2a6bfac376d31.zip |
a small refactoring of symbols in the post.py
-rw-r--r-- | askbot/models/post.py | 11 | ||||
-rw-r--r-- | askbot/tests/post_model_tests.py | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/askbot/models/post.py b/askbot/models/post.py index 9d1c9513..2592ee94 100644 --- a/askbot/models/post.py +++ b/askbot/models/post.py @@ -442,7 +442,7 @@ class Post(models.Model): return data #todo: when models are merged, it would be great to remove author parameter - def parse_and_save_post(post, author = None, **kwargs): + def parse_and_save(post, author = None, **kwargs): """generic method to use with posts to be used prior to saving post edit or addition """ @@ -450,7 +450,7 @@ class Post(models.Model): assert(author is not None) last_revision = post.html - data = post.parse() + data = post.parse_post_text() post.html = data['html'] newly_mentioned_users = set(data['newly_mentioned_users']) - set([author]) @@ -496,13 +496,6 @@ class Post(models.Model): except Exception: logging.debug('cannot ping google - did you register with them?') - ###################################### - # TODO: Rename the methods above instead of doing this assignment - parse = parse_post_text - parse_and_save = parse_and_save_post - ###################################### - - def is_question(self): return self.post_type == 'question' diff --git a/askbot/tests/post_model_tests.py b/askbot/tests/post_model_tests.py index dd1399c1..9a4d47c8 100644 --- a/askbot/tests/post_model_tests.py +++ b/askbot/tests/post_model_tests.py @@ -344,7 +344,7 @@ class ThreadRenderLowLevelCachingTests(AskbotTestCase): # Make sure that title and body text are escaped properly. # This should be obvious at this point, if the above test passes, but why not be explicit # UPDATE: And voila, these tests catched double-escaping bug in template, where `<` was `&lt;` - # And indeed, post.summary is escaped before saving, in parse_and_save_post() + # And indeed, post.summary is escaped before saving, in parse_and_save() # UPDATE 2:Weird things happen with question summary (it's double escaped etc., really weird) so # let's just make sure that there are no tag placeholders left self.assertTrue('<<<tag1>>> fake title' in proper_html) |