【发布时间】:2017-05-29 13:22:49
【问题描述】:
我按照教程从干燥站点中的 APITestCase 文档中进行测试。但我可以在 drf 文档中找到一些疑问的答案。
我有一个 APITestCase 子类如下
class GroupTest(APITestCase):
def setUp(self):
.
.
def tearDown(self):
.
.
def test_case_A(self):
.
# I create a group here
# but I dont delete the group object in case A
.
def test_case_B(self):
.
# Will the group object from case A exist in case B ?
# are the different test methods in a APITestCase independent?
.
如果我在 GroupTest 类中有两个测试用例,它们是独立的吗?在案例 A 中创建的组对象会影响案例 B 吗?
【问题讨论】:
标签: django unit-testing django-rest-framework