Skip to content

Commit

Permalink
change in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Aug 31, 2023
1 parent e76ba15 commit c77a546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apps/xero/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from .actions import get_xero_connector, sync_tenant, sync_dimensions, refersh_xero_dimension
from fyle_xero_api.utils import LookupFieldMixin
from django_filters.rest_framework import DjangoFilterBackend

class TokenHealthView(generics.RetrieveAPIView):
"""
Expand All @@ -37,6 +38,7 @@ class TenantView(LookupFieldMixin, generics.ListCreateAPIView):
"""
queryset = DestinationAttribute.objects.all()
serializer_class = DestinationAttributeSerializer
filter_backends = (DjangoFilterBackend,)
pagination_class = None
filterset_fields = {
'attribute_type': {'exact'}
Expand Down Expand Up @@ -107,13 +109,14 @@ def post(self, request, *args, **kwargs):
)


class DestinationAttributesView(generics.ListAPIView):
class DestinationAttributesView(LookupFieldMixin, generics.ListAPIView):
"""
Destination Attributes view
"""

queryset = DestinationAttribute.objects.all()
serializer_class = DestinationAttributeSerializer
filter_backends = (DjangoFilterBackend,)
pagination_class = None
filterset_fields = {'attribute_type': {'exact', 'in'}, 'active': {'exact'}}
ordering_fields = ('value',)
4 changes: 2 additions & 2 deletions tests/test_xero/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_get_tenant_view(api_client, test_connection):
workspace_id = 1

access_token = test_connection.access_token
url = '/api/workspaces/{}/xero/tenants/'.format(workspace_id)
url = '/api/workspaces/{}/xero/tenants/?attribute_type=TENANT'.format(workspace_id)

api_client.credentials(HTTP_AUTHORIZATION='Bearer {}'.format(access_token))

Expand Down Expand Up @@ -189,7 +189,7 @@ def test_get_destination_attributes_view(api_client, test_connection):
response = api_client.get(
url,
data={
'attribute_types': ['CUSTOMER'],
'attribute_types__in': 'CUSTOMER',
'active': 'true'
}
)
Expand Down

0 comments on commit c77a546

Please sign in to comment.