Show More
@@ -1,35 +1,35 b'' | |||
|
1 | 1 | from django.test import TestCase |
|
2 | 2 | from boards.mdx_neboard import Parser |
|
3 | 3 | from boards.models import Post |
|
4 | 4 | |
|
5 | 5 | |
|
6 | 6 | class ParserTest(TestCase): |
|
7 | 7 | def test_preparse_quote(self): |
|
8 | 8 | raw_text = '>quote\nQuote in >line\nLine\n>Quote' |
|
9 | 9 | preparsed_text = Parser().preparse(raw_text) |
|
10 | 10 | |
|
11 | 11 | self.assertEqual( |
|
12 | 12 | '[quote]quote[/quote]\nQuote in >line\nLine\n[quote]Quote[/quote]', |
|
13 | 13 | preparsed_text, 'Quote not preparsed.') |
|
14 | 14 | |
|
15 | 15 | def test_preparse_comment(self): |
|
16 | 16 | raw_text = '//comment' |
|
17 | 17 | preparsed_text = Parser().preparse(raw_text) |
|
18 | 18 | |
|
19 | 19 | self.assertEqual('[comment]comment[/comment]', preparsed_text, |
|
20 | 20 | 'Comment not preparsed.') |
|
21 | 21 | |
|
22 | 22 | def test_preparse_reflink(self): |
|
23 | 23 | raw_text = '>>12\nText' |
|
24 | 24 | preparsed_text = Parser().preparse(raw_text) |
|
25 | 25 | |
|
26 | 26 | self.assertEqual('[post]12[/post]\nText', |
|
27 | 27 | preparsed_text, 'Reflink not preparsed.') |
|
28 | 28 | |
|
29 | def preparse_user(self): | |
|
29 | def test_preparse_user(self): | |
|
30 | 30 | raw_text = '@user\nuser@example.com\n@user\nuser @user' |
|
31 | 31 | preparsed_text = Parser().preparse(raw_text) |
|
32 | 32 | |
|
33 | 33 | self.assertEqual('[user]user[/user]\nuser@example.com\n[user]user[/user]\nuser [user]user[/user]', |
|
34 | 34 | preparsed_text, 'User link not preparsed.') |
|
35 | 35 |
General Comments 0
You need to be logged in to leave comments.
Login now