diff --git a/blitz_api/tests/tests_view_Users.py b/blitz_api/tests/tests_view_Users.py index 77bcc09d..eebaf497 100644 --- a/blitz_api/tests/tests_view_Users.py +++ b/blitz_api/tests/tests_view_Users.py @@ -613,7 +613,6 @@ def test_list_users(self): membership = { 'url': 'http://testserver/memberships/' + str(self.membership.id), 'id': self.membership.id, - 'order_lines': [], 'name': 'basic_membership', 'available': True, 'available_on_product_types': [], diff --git a/store/serializers.py b/store/serializers.py index fd0c2ec7..481f57d4 100644 --- a/store/serializers.py +++ b/store/serializers.py @@ -102,11 +102,7 @@ def validate(self, attrs): class BaseProductSerializer(serializers.HyperlinkedModelSerializer): id = serializers.ReadOnlyField() - order_lines = serializers.HyperlinkedRelatedField( - many=True, - read_only=True, - view_name='orderline-detail' - ) + price = serializers.DecimalField( max_digits=6, decimal_places=2, @@ -150,7 +146,6 @@ def to_representation(self, instance): self.fields['options'] = BaseProductManagerSerializer(many=True) data = super(BaseProductSerializer, self).to_representation(instance) if not user.is_staff: - data.pop("order_lines") data = remove_translation_fields(data) return data diff --git a/store/tests/tests_viewset_Membership.py b/store/tests/tests_viewset_Membership.py index f9cc36b3..eb2a0c49 100644 --- a/store/tests/tests_viewset_Membership.py +++ b/store/tests/tests_viewset_Membership.py @@ -77,7 +77,6 @@ def test_create(self): 'details': '3-Year student membership', 'duration': '1095 00:00:00', 'name': 'advanced_membership', - 'order_lines': [], 'price': '125.00', 'academic_levels': ['http://testserver/academic_levels/' + str(self.academic_level.id)], @@ -249,7 +248,6 @@ def test_update(self): 'details': '1-Year student membership', 'duration': '365 00:00:00', 'name': 'basic_membership_updated', - 'order_lines': [], 'price': '10.00', 'url': 'http://testserver/memberships/' + str(self.membership.id), 'id': self.membership.id, @@ -383,7 +381,6 @@ def test_list_as_admin(self): 'details': '1-Year student membership', 'duration': '365 00:00:00', 'name': 'basic_membership', - 'order_lines': [], 'price': '50.00', 'url': 'http://testserver/memberships/' + str(self.membership.id), @@ -398,7 +395,6 @@ def test_list_as_admin(self): 'details': 'todo', 'duration': '365 00:00:00', 'name': 'pending_membership', - 'order_lines': [], 'price': '50.00', 'url': 'http://testserver/memberships/' + str(self.membership_unavailable.id), @@ -464,7 +460,6 @@ def test_read_as_admin(self): 'details': '1-Year student membership', 'duration': '365 00:00:00', 'name': 'basic_membership', - 'order_lines': [], 'price': '50.00', 'url': 'http://testserver/memberships/' + str(self.membership.id), 'academic_levels': ['http://testserver/academic_levels/' + diff --git a/store/tests/tests_viewset_Package.py b/store/tests/tests_viewset_Package.py index a139c086..1dd08b02 100644 --- a/store/tests/tests_viewset_Package.py +++ b/store/tests/tests_viewset_Package.py @@ -95,7 +95,6 @@ def test_create(self): f'http://testserver/memberships/{self.membership.id}'], 'available': True, 'name': 'basic_package', - 'order_lines': [], 'price': '50.00', 'reservations': 10, 'available_on_product_types': [], @@ -300,8 +299,6 @@ def test_update(self): 'exclusive_memberships': [], 'id': self.package.id, 'name': 'extreme_package_updated', - 'order_lines': [ - f'http://testserver/order_lines/{self.order_line.id}'], 'price': '1.00', 'reservations': 999, 'url': f'http://testserver/packages/{self.package.id}', @@ -343,8 +340,6 @@ def test_update_partial(self): 'exclusive_memberships': [], 'id': self.package.id, 'name': 'extreme_package', - 'order_lines': [ - f'http://testserver/order_lines/{self.order_line.id}'], 'price': '99.00', 'reservations': 100, 'url': f'http://testserver/packages/{self.package.id}', @@ -474,8 +469,6 @@ def test_list_as_admin(self): 'exclusive_memberships': [], 'id': self.package.id, 'name': 'extreme_package', - 'order_lines': [ - f'http://testserver/order_lines/{self.order_line.id}'], 'price': '400.00', 'reservations': 100, 'url': f'http://testserver/packages/{self.package.id}', @@ -488,7 +481,6 @@ def test_list_as_admin(self): 'exclusive_memberships': [], 'id': self.package_unavailable.id, 'name': 'pending_package', - 'order_lines': [], 'price': '400.00', 'reservations': 100, 'url': @@ -553,8 +545,6 @@ def test_read_admin(self): 'exclusive_memberships': [], 'id': self.package.id, 'name': 'extreme_package', - 'order_lines': [ - f'http://testserver/order_lines/{self.order_line.id}'], 'price': '400.00', 'reservations': 100, 'url': f'http://testserver/packages/{self.package.id}',