【发布时间】:2021-12-06 19:46:16
【问题描述】:
大家
我创建了TestCase,但是当我输入命令“python manage.py test”时,这个测试不起作用。 你能帮帮我吗?
from django.test import TestCase
from accounts.models import UserProfile
class AccountsTestCase(TestCase):
def setUp(self):
print('test_setUp')
UserProfile.objects.create(email='test@test.com', password='user111333')
def get_user(self):
user = UserProfile.objects.get(email='test@test.com')
【问题讨论】:
-
你是否在settings.py中配置了测试数据库
标签: django testing installation testcase