Skip to content

Commit 2ab2072

Browse files
committed
update unit test
1 parent 2118b22 commit 2ab2072

9 files changed

Lines changed: 143 additions & 143 deletions

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_m2m.py

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_m2m_back_populates.py

Lines changed: 49 additions & 49 deletions
Large diffs are not rendered by default.

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_m2o.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_get_many_with_join():
7171
assert response.json() == [
7272
{
7373
"id": 1,
74-
"child_id_foreign": [
74+
"child_m2o_foreign": [
7575
{
7676
"id": 1
7777
}
@@ -80,7 +80,7 @@ def test_get_many_with_join():
8080
},
8181
{
8282
"id": 2,
83-
"child_id_foreign": [
83+
"child_m2o_foreign": [
8484
{
8585
"id": 1
8686
}
@@ -89,7 +89,7 @@ def test_get_many_with_join():
8989
},
9090
{
9191
"id": 3,
92-
"child_id_foreign": [
92+
"child_m2o_foreign": [
9393
{
9494
"id": 2
9595
}
@@ -98,7 +98,7 @@ def test_get_many_with_join():
9898
},
9999
{
100100
"id": 4,
101-
"child_id_foreign": [
101+
"child_m2o_foreign": [
102102
{
103103
"id": 2
104104
}
@@ -112,7 +112,7 @@ def test_get_many_with_join():
112112
assert response.status_code == 200
113113
assert response.json() == {
114114
"id": 1,
115-
"child_id_foreign": [
115+
"child_m2o_foreign": [
116116
{
117117
"id": 1
118118
}

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_m2o_back_populates.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_get_parent_many_with_join():
7171
assert response.json() == [
7272
{
7373
"id": 1,
74-
"child_id_foreign": [
74+
"child_m2o_back_populates_foreign": [
7575
{
7676
"id": 1
7777
}
@@ -80,7 +80,7 @@ def test_get_parent_many_with_join():
8080
},
8181
{
8282
"id": 2,
83-
"child_id_foreign": [
83+
"child_m2o_back_populates_foreign": [
8484
{
8585
"id": 1
8686
}
@@ -89,7 +89,7 @@ def test_get_parent_many_with_join():
8989
},
9090
{
9191
"id": 3,
92-
"child_id_foreign": [
92+
"child_m2o_back_populates_foreign": [
9393
{
9494
"id": 2
9595
}
@@ -98,7 +98,7 @@ def test_get_parent_many_with_join():
9898
},
9999
{
100100
"id": 4,
101-
"child_id_foreign": [
101+
"child_m2o_back_populates_foreign": [
102102
{
103103
"id": 2
104104
}
@@ -112,7 +112,7 @@ def test_get_parent_many_with_join():
112112
assert response.status_code == 200
113113
assert response.json() == {
114114
"id": 1,
115-
"child_id_foreign": [
115+
"child_m2o_back_populates_foreign": [
116116
{
117117
"id": 1
118118
}
@@ -132,7 +132,7 @@ def test_get_child_many_with_join():
132132
a = response.json()
133133
assert response.json() == [
134134
{
135-
"id_foreign": [
135+
"parent_m2o_back_populates_foreign": [
136136
{
137137
"id": 1,
138138
"child_id": 1
@@ -145,7 +145,7 @@ def test_get_child_many_with_join():
145145
"id": 1
146146
},
147147
{
148-
"id_foreign": [
148+
"parent_m2o_back_populates_foreign": [
149149
{
150150
"id": 3,
151151
"child_id": 2
@@ -163,7 +163,7 @@ def test_get_child_many_with_join():
163163
a = response.json()
164164

165165
assert response.json() == {
166-
"id_foreign": [
166+
"parent_m2o_back_populates_foreign": [
167167
{
168168
"id": 1,
169169
"child_id": 1

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_m2o_back_refer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_get_parent_many_with_join():
6969
assert response.json() == [
7070
{
7171
"id": 1,
72-
"child_id_foreign": [
72+
"child_m2o_back_populates_foreign": [
7373
{
7474
"id": 1
7575
}
@@ -78,7 +78,7 @@ def test_get_parent_many_with_join():
7878
},
7979
{
8080
"id": 2,
81-
"child_id_foreign": [
81+
"child_m2o_back_populates_foreign": [
8282
{
8383
"id": 1
8484
}
@@ -87,7 +87,7 @@ def test_get_parent_many_with_join():
8787
},
8888
{
8989
"id": 3,
90-
"child_id_foreign": [
90+
"child_m2o_back_populates_foreign": [
9191
{
9292
"id": 2
9393
}
@@ -96,7 +96,7 @@ def test_get_parent_many_with_join():
9696
},
9797
{
9898
"id": 4,
99-
"child_id_foreign": [
99+
"child_m2o_back_populates_foreign": [
100100
{
101101
"id": 2
102102
}
@@ -110,7 +110,7 @@ def test_get_parent_many_with_join():
110110
assert response.status_code == 200
111111
assert response.json() == {
112112
"id": 1,
113-
"child_id_foreign": [
113+
"child_m2o_back_populates_foreign": [
114114
{
115115
"id": 1
116116
}
@@ -129,7 +129,7 @@ def test_get_child_many_with_join():
129129
assert response.status_code == 200
130130
assert response.json() == [
131131
{
132-
"id_foreign": [
132+
"parent_m2o_back_populates_foreign": [
133133
{
134134
"id": 1,
135135
"child_id": 1
@@ -142,7 +142,7 @@ def test_get_child_many_with_join():
142142
"id": 1
143143
},
144144
{
145-
"id_foreign": [
145+
"parent_m2o_back_populates_foreign": [
146146
{
147147
"id": 3,
148148
"child_id": 2
@@ -158,7 +158,7 @@ def test_get_child_many_with_join():
158158
response = client.get('/child/1?join_foreign_table=parent_m2o_back_populates', headers=headers)
159159
assert response.status_code == 200
160160
assert response.json() == {
161-
"id_foreign": [
161+
"parent_m2o_back_populates_foreign": [
162162
{
163163
"id": 1,
164164
"child_id": 1

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_o2m.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_get_many_with_join():
7070
assert response.status_code == 200
7171
assert response.json() == [
7272
{
73-
"id_foreign": [
73+
"child_one_to_many_foreign": [
7474
{
7575
"id": 1,
7676
"parent_id": 1
@@ -83,7 +83,7 @@ def test_get_many_with_join():
8383
"id": 1
8484
},
8585
{
86-
"id_foreign": [
86+
"child_one_to_many_foreign": [
8787
{
8888
"id": 3,
8989
"parent_id": 2
@@ -100,7 +100,7 @@ def test_get_many_with_join():
100100
response = client.get('/parent/1?join_foreign_table=child_one_to_many', headers=headers)
101101
assert response.status_code == 200
102102
assert response.json() == {
103-
"id_foreign": [
103+
"child_one_to_many_foreign": [
104104
{
105105
"id": 1,
106106
"parent_id": 1

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_o2m_back_populates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_get_many_with_join():
6868
assert response.status_code == 200
6969
assert response.json() == [
7070
{
71-
"id_foreign": [
71+
"child_one_to_many_back_populates_foreign": [
7272
{
7373
"id": 1,
7474
"parent_id": 1
@@ -81,7 +81,7 @@ def test_get_many_with_join():
8181
"id": 1
8282
},
8383
{
84-
"id_foreign": [
84+
"child_one_to_many_back_populates_foreign": [
8585
{
8686
"id": 3,
8787
"parent_id": 2
@@ -97,7 +97,7 @@ def test_get_many_with_join():
9797
response = client.get('/parent/1?join_foreign_table=child_one_to_many_back_populates', headers=headers)
9898
assert response.status_code == 200
9999
assert response.json() == {
100-
"id_foreign": [
100+
"child_one_to_many_back_populates_foreign": [
101101
{
102102
"id": 1,
103103
"parent_id": 1

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_o2m_back_ref.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_get_many_with_join():
6767
assert response.status_code == 200
6868
assert response.json() == [
6969
{
70-
"id_foreign": [
70+
"child_one_to_many_back_ref_foreign": [
7171
{
7272
"id": 1,
7373
"parent_id": 1
@@ -80,7 +80,7 @@ def test_get_many_with_join():
8080
"id": 1
8181
},
8282
{
83-
"id_foreign": [
83+
"child_one_to_many_back_ref_foreign": [
8484
{
8585
"id": 3,
8686
"parent_id": 2
@@ -96,7 +96,7 @@ def test_get_many_with_join():
9696
response = client.get('/parent/1?join_foreign_table=child_one_to_many_back_ref', headers=headers)
9797
assert response.status_code == 200
9898
assert response.json() == {
99-
"id_foreign": [
99+
"child_one_to_many_back_ref_foreign": [
100100
{
101101
"id": 1,
102102
"parent_id": 1

tests/test_implementations/test_sqlalchemy/api_test/join_relationship/test_relationship_o2o.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_get_parent_many_with_join():
7373
assert response.status_code == 200
7474
assert response.json() == [
7575
{
76-
"id_foreign": [
76+
"child_o2o_foreign": [
7777
{
7878
"id": 1,
7979
"parent_id": 1
@@ -86,7 +86,7 @@ def test_get_parent_many_with_join():
8686
"id": 1
8787
},
8888
{
89-
"id_foreign": [
89+
"child_o2o_foreign": [
9090
{
9191
"id": 3,
9292
"parent_id": 2
@@ -104,7 +104,7 @@ def test_get_parent_many_with_join():
104104
response = client.get('/parent/1?join_foreign_table=child_o2o', headers=headers)
105105
assert response.status_code == 200
106106
assert response.json() == {
107-
"id_foreign": [
107+
"child_o2o_foreign": [
108108
{
109109
"id": 1,
110110
"parent_id": 1
@@ -129,7 +129,7 @@ def test_get_child_many_with_join():
129129
assert response.json() == [
130130
{
131131
"id": 1,
132-
"parent_id_foreign": [
132+
"parent_o2o_foreign": [
133133
{
134134
"id": 1
135135
}
@@ -138,7 +138,7 @@ def test_get_child_many_with_join():
138138
},
139139
{
140140
"id": 2,
141-
"parent_id_foreign": [
141+
"parent_o2o_foreign": [
142142
{
143143
"id": 1
144144
}
@@ -147,7 +147,7 @@ def test_get_child_many_with_join():
147147
},
148148
{
149149
"id": 3,
150-
"parent_id_foreign": [
150+
"parent_o2o_foreign": [
151151
{
152152
"id": 2
153153
}
@@ -156,7 +156,7 @@ def test_get_child_many_with_join():
156156
},
157157
{
158158
"id": 4,
159-
"parent_id_foreign": [
159+
"parent_o2o_foreign": [
160160
{
161161
"id": 2
162162
}
@@ -168,7 +168,7 @@ def test_get_child_many_with_join():
168168
assert response.status_code == 200
169169
assert response.json() =={
170170
"id": 1,
171-
"parent_id_foreign": [
171+
"parent_o2o_foreign": [
172172
{
173173
"id": 1
174174
}

0 commit comments

Comments
 (0)