Fix tests

remotes/origin/endpoint-for-estimation-system-new
Álex Hermida 2018-06-13 11:59:29 +02:00 committed by Alex Hermida
parent 02558ed15f
commit e88c380329
2 changed files with 8 additions and 1 deletions

View File

@ -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():

View File

@ -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)