Skip to content

Commit 2c4afa6

Browse files
committed
Uncommented and modified remaining tests
1 parent 8c2f4cb commit 2c4afa6

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

tests/api/views/test_projectView.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def test_create_project(self, client):
1717
response = client.post('/projects', json=self.valid_data)
1818
assert response.status_code == 201
1919

20-
# response = client.post('/projects')
21-
# assert response.status_code == 400
20+
response = client.post('/projects')
21+
assert response.status_code == 400
2222

2323
def test_update_project(self, client):
2424

@@ -85,13 +85,17 @@ def test_update_project_link(self, client):
8585

8686
url = '/projects/{0}/links/{1}'
8787

88-
# notice: this shouldn't give 500 error
89-
# response = client.post(url.format(p1["id"], 0))
90-
# assert response.status_code == 404
88+
response = client.put(url.format(p1["id"], 0), json={"name": "NLink"})
89+
assert response.status_code == 404
90+
91+
response = client.put(url.format(p1["id"], 0))
92+
assert response.status_code == 400
9193

92-
# notice: this shouldn't give 500 error
93-
# response = client.post(url.format(0, p1_link["id"]))
94-
# assert response.status_code == 404
94+
response = client.put(url.format(0, p1_link["id"]), json={"name": "NLink"})
95+
assert response.status_code == 404
96+
97+
response = client.put(url.format(0, p1_link["id"]))
98+
assert response.status_code == 400
9599

96100
response = client.put(url.format(p1["id"], p1_link["id"]), json={"name": "Nlink"})
97101
assert response.status_code == 200

tests/api/views/test_userView.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ def test_create_user(self, client):
2424
def test_update_user(self, client):
2525
user_id = create_user_for_test_cases(self.valid_data)["id"]
2626

27-
response = client.put('/users/1', json={})
27+
response = client.put('/users/1', json={"name": "Updated name"})
2828
assert response.status_code == 404
2929

30-
# notice: Should we respond to update_user request without json data with status code 200?
31-
# response = client.post('/users/{}'.format(user_id), json={})
32-
# assert response.status_code == 400
30+
response = client.put('/users/1', json={})
31+
assert response.status_code == 400
32+
33+
response = client.put('/users/{}'.format(user_id), json={})
34+
assert response.status_code == 400
3335

3436
response = client.put('/users/{}'.format(user_id), json={"name": "Updated Name"})
3537
assert response.status_code == 200
@@ -117,9 +119,8 @@ def test_update_user_link(self, client):
117119
response = client.put(url, json={"link_id": 1})
118120
assert response.status_code == 400
119121

120-
# notice: Should we respond to update_user request without json data with status code 200?
121-
# response = client.post(url, json={})
122-
# assert response.status_code == 400
122+
response = client.put(url, json={})
123+
assert response.status_code == 400
123124

124125
response = client.put(url, json={"name": "New Name"})
125126
assert response.status_code == 200

0 commit comments

Comments
 (0)