Fix tests
parent
f86f429c4c
commit
5ef687dcf8
|
@ -372,7 +372,7 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
|
||||||
try:
|
try:
|
||||||
user = user_model.objects.get(id=user_id)
|
user = user_model.objects.get(id=user_id)
|
||||||
except user_model.DoesNotExist:
|
except user_model.DoesNotExist:
|
||||||
return response.BadRequest(_("Project already have due dates"))
|
return response.BadRequest(_("The user doesn't exist"))
|
||||||
|
|
||||||
# Check the user is a membership from the project
|
# Check the user is a membership from the project
|
||||||
if not project.memberships.filter(user=user).exists():
|
if not project.memberships.filter(user=user).exists():
|
||||||
|
|
|
@ -237,9 +237,15 @@ def test_valid_project_import_with_extra_data(client):
|
||||||
"task_statuses": [{
|
"task_statuses": [{
|
||||||
"name": "Test"
|
"name": "Test"
|
||||||
}],
|
}],
|
||||||
|
"task_duedates": [{
|
||||||
|
"name": "Test"
|
||||||
|
}],
|
||||||
"issue_statuses": [{
|
"issue_statuses": [{
|
||||||
"name": "Test"
|
"name": "Test"
|
||||||
}],
|
}],
|
||||||
|
"issue_duedates": [{
|
||||||
|
"name": "Test"
|
||||||
|
}],
|
||||||
}
|
}
|
||||||
|
|
||||||
response = client.json.post(url, json.dumps(data))
|
response = client.json.post(url, json.dumps(data))
|
||||||
|
@ -276,6 +282,7 @@ def test_invalid_project_import_without_roles(client):
|
||||||
assert len(response.data) == 2
|
assert len(response.data) == 2
|
||||||
assert Project.objects.filter(slug="imported-project").count() == 0
|
assert Project.objects.filter(slug="imported-project").count() == 0
|
||||||
|
|
||||||
|
|
||||||
def test_invalid_project_import_with_extra_data(client):
|
def test_invalid_project_import_with_extra_data(client):
|
||||||
user = f.UserFactory.create()
|
user = f.UserFactory.create()
|
||||||
client.login(user)
|
client.login(user)
|
||||||
|
|
Loading…
Reference in New Issue