Skip to content

Commit

Permalink
rename TrakOrg* serializers and test classes to Org*
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed May 28, 2024
1 parent 39e4529 commit 6b5ceeb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/apps/org/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from apps.org.models import Org


class TrakOrgSerializer(ModelSerializer):
class OrgSerializer(ModelSerializer):
"""Haztrak Organization Model Serializer"""

id = serializers.CharField(
Expand Down
2 changes: 1 addition & 1 deletion server/apps/org/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from apps.org.models import Org


class TestTrakOrgModel:
class TestOrgModel:
def test_haztrak_org_factory(self, org_factory):
org = org_factory()
assert isinstance(org, Org)
Expand Down
8 changes: 4 additions & 4 deletions server/apps/org/tests/test_serializers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from apps.org.serializers import TrakOrgSerializer
from apps.org.serializers import OrgSerializer


class TestTrakOrgSerializer:
class TestOrgSerializer:
def test_rcrainfo_integrated_is_true(
self, org_factory, profile_factory, rcrainfo_profile_factory, user_factory
):
Expand All @@ -12,7 +12,7 @@ def test_rcrainfo_integrated_is_true(
)
profile_factory(user=admin, rcrainfo_profile=rcra_profile)
org = org_factory(admin=admin)
serializer = TrakOrgSerializer(org)
serializer = OrgSerializer(org)
assert serializer.data["rcrainfoIntegrated"] is True

def test_rcrainfo_integrated_is_false(
Expand All @@ -25,5 +25,5 @@ def test_rcrainfo_integrated_is_false(
)
profile_factory(user=admin, rcrainfo_profile=rcra_profile)
org = org_factory(admin=admin)
serializer = TrakOrgSerializer(org)
serializer = OrgSerializer(org)
assert serializer.data["rcrainfoIntegrated"] is False
2 changes: 1 addition & 1 deletion server/apps/org/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from apps.org.views import OrgDetailsView


class TestTrakOrgDetailsView:
class TestOrgDetailsView:
base_url = "/api/org"
factory = APIRequestFactory()

Expand Down
6 changes: 3 additions & 3 deletions server/apps/org/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rest_framework.response import Response

from apps.org.models import Org
from apps.org.serializers import TrakOrgSerializer
from apps.org.serializers import OrgSerializer
from apps.org.services import get_org_by_id

logger = logging.getLogger(__name__)
Expand All @@ -16,12 +16,12 @@
class OrgDetailsView(RetrieveAPIView):
"""Retrieve details for a given Org"""

serializer_class = TrakOrgSerializer
serializer_class = OrgSerializer
queryset = Org.objects.all()
lookup_url_kwarg = "org_id"

@method_decorator(cache_page(60 * 15))
def get(self, request, *args, **kwargs):
org = get_org_by_id(self.kwargs["org_id"])
serializer = TrakOrgSerializer(org)
serializer = OrgSerializer(org)
return Response(data=serializer.data, status=status.HTTP_200_OK)
4 changes: 2 additions & 2 deletions server/apps/profile/serializers/trak_profile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer

from apps.org.serializers import TrakOrgSerializer
from apps.org.serializers import OrgSerializer
from apps.profile.models import TrakProfile
from apps.site.serializers import SiteAccessSerializer

Expand All @@ -16,7 +16,7 @@ class TrakProfileSerializer(ModelSerializer):
source="user.site_permissions",
many=True,
)
org = TrakOrgSerializer(
org = OrgSerializer(
source="user.org_permissions.org",
required=False,
)
Expand Down

0 comments on commit 6b5ceeb

Please sign in to comment.