From 1e0a46f5fc9cf11e3d67e29edb06b5e86e8daff7 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:32:30 -0600 Subject: [PATCH] Fix merge conflicts --- src/registrar/templates/domain_sidebar.html | 5 +++-- src/registrar/tests/test_views.py | 7 ------- src/registrar/tests/test_views_domain.py | 10 ++++++++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html index 71e492fce..e38e8fa14 100644 --- a/src/registrar/templates/domain_sidebar.html +++ b/src/registrar/templates/domain_sidebar.html @@ -8,7 +8,9 @@ {% include "includes/domain_sidenav_item.html" with item_text="Domain overview" %} {% endwith %} - {% if is_org_user %} + {% if is_editable %} + + {% if portfolio %} {% comment %} TODO - uncomment in #2352 {% with url_name="domain-suborganization" %} {% include "includes/domain_sidenav_item.html" with item_text="Suborganization" %} @@ -23,7 +25,6 @@ {% endwith %} {% endif %} - {% if is_editable %}
  • {% url 'domain-dns' pk=domain.id as url %} diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 694b5bf29..896c502e0 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -73,13 +73,6 @@ class TestWithUser(MockEppLib): def tearDownClass(cls): super().tearDownClass() User.objects.all().delete() - # For some reason, if this is done on the test directly, - # we get a django.db.models.deletion.ProtectedError on "User". - # In either event, it doesn't hurt to have these here given their - # relationship. - Suborganization.objects.all().delete() - Portfolio.objects.all().delete() - SeniorOfficial.objects.all().delete() class TestEnvironmentVariablesEffects(TestCase): diff --git a/src/registrar/tests/test_views_domain.py b/src/registrar/tests/test_views_domain.py index 95addfda9..6af46e0c2 100644 --- a/src/registrar/tests/test_views_domain.py +++ b/src/registrar/tests/test_views_domain.py @@ -6,7 +6,6 @@ from django.urls import reverse from django.contrib.auth import get_user_model from waffle.testutils import override_flag from api.tests.common import less_console_noise_decorator -from registrar.models.portfolio import Portfolio from .common import MockEppLib, MockSESClient, create_user # type: ignore from django_webtest import WebTest # type: ignore import boto3_mocking # type: ignore @@ -142,6 +141,7 @@ class TestWithDomainPermissions(TestWithUser): Host.objects.all().delete() Domain.objects.all().delete() UserDomainRole.objects.all().delete() + Suborganization.objects.all().delete() Portfolio.objects.all().delete() except ValueError: # pass if already deleted pass @@ -1151,7 +1151,7 @@ class TestDomainSeniorOfficial(TestDomainOverview): # Add a portfolio to the current domain portfolio = Portfolio.objects.create(creator=self.user, organization_name="Ice Cream") - Suborganization.objects.create(portfolio=portfolio, name="Vanilla") + _suborg = Suborganization.objects.create(portfolio=portfolio, name="Vanilla") # Add the portfolio to the domain_information object self.domain_information.portfolio = portfolio @@ -1183,6 +1183,12 @@ class TestDomainSeniorOfficial(TestDomainOverview): self.assertNotContains(page, "Testy") self.assertContains(page, "Bob") + # Cleanup + self.domain_information.delete() + _suborg.delete() + portfolio.delete() + senior_official.delete() + @less_console_noise_decorator def test_domain_edit_senior_official_in_place(self): """When editing a senior official for domain information and SO is not