Skip to content

Commit 15c92b3

Browse files
committed
updated tests.py for resolving conflicts
1 parent b6b5650 commit 15c92b3

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

backend/family_tree/student/tests.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@
77

88
class StudentTestCases(GraphQLTestCase):
99
GRAPHQL_URL = 'http://localhost/graphql'
10+
1011
def setUp(self):
11-
super().setUp()
12-
self.student1 = mixer.blend(Student, roll_no="B20AI014", parentId="B20AI100", name="Jaimin")
13-
self.student2 = mixer.blend(Student, roll_no="B20AI100")
14-
student2_roll_no = self.student2.roll_no
12+
super().setUp()
13+
self.student1 = mixer.blend(Student, name='student1', roll_no='1', parentId='root')
14+
self.student2 = mixer.blend(Student, name='student2', roll_no='2', parentId='1')
15+
self.student3 = mixer.blend(Student, name='student3', roll_no='3', parentId='1')
16+
self.student4 = mixer.blend(Student, name='student4', roll_no='4', parentId='1')
1517

1618
def test_children_query(self):
17-
response = self.query( '''
19+
response = self.query('''
1820
query {
19-
children(parentId: "B20AI100"){
21+
children(parentId: "1"){
2022
rollNo
2123
name
2224
}
2325
}
24-
''' )
25-
26+
''')
27+
2628
content = json.loads(response.content)
2729
self.assertResponseNoErrors(response)
28-
self.assertDictEqual(content['data']['children'][0], {'rollNo': 'B20AI014', 'name': 'Jaimin'})
30+
self.assertDictEqual(content['data']['children'][0], {'rollNo': '2', 'name': 'student2'})
31+
self.assertDictEqual(content['data']['children'][1], {'rollNo': '3', 'name': 'student3'})
32+
self.assertDictEqual(content['data']['children'][2], {'rollNo': '4', 'name': 'student4'})

0 commit comments

Comments
 (0)