From 1f6382a09ec439072cd6dac3236f19cadc24ae10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Fri, 1 Apr 2016 14:13:20 +0200 Subject: [PATCH] Issue #4044: I can import featured projects into Taiga, and they become featured --- taiga/export_import/service.py | 1 + tests/integration/test_importer_api.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/taiga/export_import/service.py b/taiga/export_import/service.py index 9a739604..11ea8b4f 100644 --- a/taiga/export_import/service.py +++ b/taiga/export_import/service.py @@ -159,6 +159,7 @@ def store_project(data): "issue_types", "userstorycustomattributes", "taskcustomattributes", "issuecustomattributes", "roles", "milestones", "wiki_pages", "wiki_links", "notify_policies", "user_stories", "issues", "tasks", + "is_featured" ] if key not in excluded_fields: project_data[key] = value diff --git a/tests/integration/test_importer_api.py b/tests/integration/test_importer_api.py index 159abb76..5b6a178c 100644 --- a/tests/integration/test_importer_api.py +++ b/tests/integration/test_importer_api.py @@ -1585,3 +1585,25 @@ def test_valid_dump_import_with_the_limit_of_membership_whit_you_for_public_proj response = client.post(url, {'dump': data}) assert response.status_code == 201 assert Project.objects.filter(slug="public-project-with-memberships-limit-with-you").count() == 1 + + +def test_valid_project_import_and_disabled_is_featured(client): + user = f.UserFactory.create() + client.login(user) + + url = reverse("importer-list") + data = { + "name": "Imported project", + "description": "Imported project", + "roles": [{ + "permissions": [], + "name": "Test" + }], + "is_featured": True + } + + response = client.post(url, json.dumps(data), content_type="application/json") + assert response.status_code == 201 + response_data = response.data + assert response_data["owner"] == user.email + assert response_data["is_featured"] == False