Fix tests

remotes/origin/3.4.0rc
Álex Hermida 2018-06-13 11:59:29 +02:00 committed by Alex Hermida
parent f86f429c4c
commit 5ef687dcf8
2 changed files with 8 additions and 1 deletions

View File

@ -372,7 +372,7 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
try:
user = user_model.objects.get(id=user_id)
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
if not project.memberships.filter(user=user).exists():

View File

@ -237,9 +237,15 @@ def test_valid_project_import_with_extra_data(client):
"task_statuses": [{
"name": "Test"
}],
"task_duedates": [{
"name": "Test"
}],
"issue_statuses": [{
"name": "Test"
}],
"issue_duedates": [{
"name": "Test"
}],
}
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 Project.objects.filter(slug="imported-project").count() == 0
def test_invalid_project_import_with_extra_data(client):
user = f.UserFactory.create()
client.login(user)