You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
791 B
37 lines
791 B
# 余秋玲: 此文件定义了DjangoBlog的测试用例
|
|
# 余秋玲: 导入Django测试框架
|
|
from django.test import TestCase
|
|
|
|
from djangoblog.utils import *
|
|
|
|
|
|
class DjangoBlogTest(TestCase):
|
|
def setUp(self):
|
|
# 余秋玲: 测试用例初始化方法
|
|
pass
|
|
|
|
def test_utils(self):
|
|
# 余秋玲: 测试工具函数
|
|
md5 = get_sha256('test')
|
|
self.assertIsNotNone(md5)
|
|
c = CommonMarkdown.get_markdown('''
|
|
# Title1
|
|
|
|
```python
|
|
import os
|
|
```
|
|
|
|
[url](https://www.lylinux.net/)
|
|
|
|
[ddd](http://www.baidu.com)
|
|
|
|
|
|
''')
|
|
self.assertIsNotNone(c)
|
|
d = {
|
|
'd': 'key1',
|
|
'd2': 'key2'
|
|
}
|
|
data = parse_dict_to_url(d)
|
|
self.assertIsNotNone(data)
|