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.
git-test/tests.py

38 lines
966 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Zxy导入 Django 的测试模块
from django.test import TestCase
# Zxy导入项目中的工具函数
from djangoblog.utils import *
# Zxy定义测试类
class DjangoBlogTest(TestCase):
def setUp(self):
# Zxy测试初始化方法暂无内容
pass
def test_utils(self):
# Zxy测试工具函数
md5 = get_sha256('test') # Zxy测试 SHA256 函数
self.assertIsNotNone(md5) # Zxy断言返回值不为空
c = CommonMarkdown.get_markdown(''' # Zxy测试 Markdown 转换
# Title1
```python
import os
```
[url](https://www.lylinux.net/)
[ddd](http://www.baidu.com)
''')
self.assertIsNotNone(c) # Zxy断言返回值不为空
d = {
'd': 'key1',
'd2': 'key2'
}
data = parse_dict_to_url(d) # Zxy测试字典转 URL 函数
self.assertIsNotNone(data) # Zxy断言返回值不为空