diff --git a/tests/integration/test_auth.py b/tests/integration/test_auth.py index 703f024d..24ef8342 100644 --- a/tests/integration/test_auth.py +++ b/tests/integration/test_auth.py @@ -336,20 +336,6 @@ def test_get_auth_token_error_inactive_user(client, settings): assert response.status_code == 401, response.data -def test_get_auth_token_error_inactive_user(client, settings): - settings.PUBLIC_REGISTER_ENABLED = False - user = factories.UserFactory(is_active=False) - - auth_data = { - "username": user.username, - "password": user.username, - "type": "normal", - } - - response = client.post(reverse("auth-list"), auth_data) - - assert response.status_code == 401, response.data - def test_get_auth_token_error_system_user(client, settings): settings.PUBLIC_REGISTER_ENABLED = False user = factories.UserFactory(is_system=True) diff --git a/tests/integration/test_hooks_bitbucket.py b/tests/integration/test_hooks_bitbucket.py index d58bcfbf..977ab277 100644 --- a/tests/integration/test_hooks_bitbucket.py +++ b/tests/integration/test_hooks_bitbucket.py @@ -556,36 +556,6 @@ def test_push_event_task_bad_processing_non_existing_ref(client): assert len(mail.outbox) == 0 -def test_push_event_task_bad_processing_non_existing_ref(client): - issue_status = f.IssueStatusFactory() - payload = { - "actor": { - "user": { - "uuid": "{ce1054cd-3f43-49dc-8aea-d3085ee7ec9b}", - "username": "test-user", - "links": {"html": {"href": "http://bitbucket.com/test-user"}} - } - }, - "push": { - "changes": [ - { - "commits": [ - { "message": "test message test TG-6666666 #%s ok bye!" % (issue_status.slug) } - ] - } - ] - } - } - mail.outbox = [] - - ev_hook = event_hooks.PushEventHook(issue_status.project, payload) - with pytest.raises(ActionSyntaxException) as excinfo: - ev_hook.process_event() - - assert str(excinfo.value) == "The referenced element doesn't exist" - assert len(mail.outbox) == 0 - - def test_push_event_us_bad_processing_non_existing_status(client): user_story = f.UserStoryFactory.create() payload = { diff --git a/tests/integration/test_hooks_gitlab.py b/tests/integration/test_hooks_gitlab.py index c6cd9c59..e6d9820a 100644 --- a/tests/integration/test_hooks_gitlab.py +++ b/tests/integration/test_hooks_gitlab.py @@ -1095,36 +1095,6 @@ def test_issues_event_opened_issue_connected_with_external_one(client): assert issue.status == issue.project.default_issue_status -def test_issues_event_updated_issue_without_connection(client): - issue = f.IssueFactory.create(external_reference=[]) - issue.project.default_issue_status = issue.status - issue.project.default_issue_type = issue.type - issue.project.default_severity = issue.severity - issue.project.default_priority = issue.priority - issue.project.save() - Membership.objects.create(user=issue.owner, project=issue.project, role=f.RoleFactory.create(project=issue.project), is_admin=True) - notify_policy = NotifyPolicy.objects.get(user=issue.owner, project=issue.project) - notify_policy.notify_level = NotifyLevel.all - notify_policy.save() - - payload = deepcopy(close_issue_base_payload) - payload["object_attributes"]["url"] = "http://gitlab.com/test/project/issues/112" - payload["object_attributes"]["state"] = "opened" - payload["object_attributes"]["action"] = "reopen" - - mail.outbox = [] - - assert Issue.objects.count() == 1 - - ev_hook = event_hooks.IssuesEventHook(issue.project, payload) - ev_hook.process_event() - - assert Issue.objects.count() == 2 - assert len(mail.outbox) == 1 - - assert Issue.objects.all().order_by("id").last().status == issue.project.default_issue_status - - # # ISSUE EVENTS: CLOSE # diff --git a/tests/integration/test_memberships.py b/tests/integration/test_memberships.py index 35fc960e..6c95eae1 100644 --- a/tests/integration/test_memberships.py +++ b/tests/integration/test_memberships.py @@ -731,15 +731,6 @@ def test_api_edit_membership(client): assert response.status_code == 200 -def test_api_edit_membership(client): - membership = f.MembershipFactory(is_admin=True) - client.login(membership.user) - url = reverse("memberships-detail", args=[membership.id]) - data = {"username": "new@email.com"} - response = client.json.patch(url, json.dumps(data)) - assert response.status_code == 200 - - def test_api_change_owner_membership_to_no_admin_return_error(client): project = f.ProjectFactory() membership_owner = f.MembershipFactory(project=project, user=project.owner, is_admin=True) diff --git a/tests/integration/test_userstories_update_backlog_order.py b/tests/integration/test_userstories_update_backlog_order.py index c7290503..21209aee 100644 --- a/tests/integration/test_userstories_update_backlog_order.py +++ b/tests/integration/test_userstories_update_backlog_order.py @@ -609,89 +609,6 @@ def test_api_update_orders_in_bulk_invalid_after_us_because_no_milestone(client) assert "after_userstory_id" in response.data -def test_api_update_orders_in_bulk_invalid_after_us_because_project(client): - project = f.create_project() - f.MembershipFactory.create(project=project, user=project.owner, is_admin=True) - us1 = f.create_userstory(project=project) - us2 = f.create_userstory(project=project) - us3 = f.create_userstory(project=project) - us4 = f.create_userstory() - - url = reverse("userstories-bulk-update-backlog-order") - - data = { - "project_id": project.id, - "before_userstory_id": us4.id, - "bulk_userstories": [us1.id, - us2.id, - us3.id] - } - - client.login(project.owner) - - response = client.json.post(url, json.dumps(data)) - assert response.status_code == 400, response.data - assert len(response.data) == 1 - assert "before_userstory_id" in response.data - - -def test_api_update_orders_in_bulk_invalid_after_us_because_milestone(client): - project = f.create_project() - f.MembershipFactory.create(project=project, user=project.owner, is_admin=True) - milestone = f.MilestoneFactory.create(project=project) - milestone2 = f.MilestoneFactory.create(project=project) - us1 = f.create_userstory(project=project) - us2 = f.create_userstory(project=project) - us3 = f.create_userstory(project=project) - us4 = f.create_userstory(project=project, milestone=milestone2) - - url = reverse("userstories-bulk-update-backlog-order") - - data = { - "project_id": project.id, - "milestone_id": milestone.id, - "before_userstory_id": us4.id, - "bulk_userstories": [us1.id, - us2.id, - us3.id] - } - - client.login(project.owner) - - response = client.json.post(url, json.dumps(data)) - assert response.status_code == 400, response.data - assert len(response.data) == 1 - assert "before_userstory_id" in response.data - - -def test_api_update_orders_in_bulk_invalid_after_us_because_no_milestone(client): - project = f.create_project() - f.MembershipFactory.create(project=project, user=project.owner, is_admin=True) - milestone = f.MilestoneFactory.create(project=project) - us1 = f.create_userstory(project=project) - us2 = f.create_userstory(project=project) - us3 = f.create_userstory(project=project) - us4 = f.create_userstory(project=project, milestone=None) - - url = reverse("userstories-bulk-update-backlog-order") - - data = { - "project_id": project.id, - "milestone_id": milestone.id, - "before_userstory_id": us4.id, - "bulk_userstories": [us1.id, - us2.id, - us3.id] - } - - client.login(project.owner) - - response = client.json.post(url, json.dumps(data)) - assert response.status_code == 400, response.data - assert len(response.data) == 1 - assert "before_userstory_id" in response.data - - def test_api_update_orders_in_bulk_invalid_before_us_because_after_us_exist(client): project = f.create_project() f.MembershipFactory.create(project=project, user=project.owner, is_admin=True)