# Path: src/oscarapicheckout/tests/base.py
# class BaseTest(APITestCase):
#     def setUp(self):
#         Country.objects.create(
#             display_order=0,
#             is_shipping_country=True,
#             iso_3166_1_a2="US",
#             iso_3166_1_a3="USA",
#             iso_3166_1_numeric="840",
#             name="United States of America",
#             printable_name="United States",
#         )
# 
#     def login(self, is_staff=False, email="joe@example.com"):
#         user = User.objects.create_user(username="joe", password="schmoe", email=email)
#         user.is_staff = is_staff
#         user.save()
#         self.client.login(username="joe", password="schmoe")
#         return user
# 
# Path: src/oscarapicheckout/cache.py
# class EmailAddressCache(AbstractCheckoutCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "email_address", "oscarapicheckout.cache.EmailAddressSerializer"
#     )
# 
# class ShippingAddressCache(AbstractCheckoutAddressCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "shipping_address", "oscarapi.serializers.checkout.ShippingAddressSerializer"
#     )
# 
# class BillingAddressCache(AbstractCheckoutAddressCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "billing_address", "oscarapi.serializers.checkout.BillingAddressSerializer"
#     )
# 
# class ShippingMethodCache(AbstractCheckoutCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "shipping_method", "oscarapicheckout.cache.ShippingMethodSerializer"
#     )


from oscar.core.loading import get_model
from .base import BaseTest
from ..cache import (
    EmailAddressCache,
    ShippingAddressCache,
    BillingAddressCache,
    ShippingMethodCache,
)
            }
        )
        self.assertEqual(
            ShippingAddressCache(1).get(),
            {
                "first_name": "Bart",
                "last_name": "Simpson",
                "line1": "123 Evergreen Terrace",
                "line4": "Springfield",
                "state": "NY",
                "postcode": "10001",
                "country": Country.objects.get(iso_3166_1_a3="USA"),
            },
        )


class BillingAddressCacheTest(BaseTest):
    def test_cache(self):
        BillingAddressCache(1).set(
            {
                "first_name": "Lisa",
                "last_name": "Simpson",
                "line1": "123 Evergreen Terrace",
                "line4": "Springfield",
                "state": "NY",
                "postcode": "10001",
                "country": Country.objects.get(iso_3166_1_a3="USA"),
            }
        )
        self.assertEqual(

# Path: src/oscarapicheckout/tests/base.py
# class BaseTest(APITestCase):
#     def setUp(self):
#         Country.objects.create(
#             display_order=0,
#             is_shipping_country=True,
#             iso_3166_1_a2="US",
#             iso_3166_1_a3="USA",
#             iso_3166_1_numeric="840",
#             name="United States of America",
#             printable_name="United States",
#         )
# 
#     def login(self, is_staff=False, email="joe@example.com"):
#         user = User.objects.create_user(username="joe", password="schmoe", email=email)
#         user.is_staff = is_staff
#         user.save()
#         self.client.login(username="joe", password="schmoe")
#         return user
# 
# Path: src/oscarapicheckout/cache.py
# class EmailAddressCache(AbstractCheckoutCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "email_address", "oscarapicheckout.cache.EmailAddressSerializer"
#     )
# 
# class ShippingAddressCache(AbstractCheckoutAddressCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "shipping_address", "oscarapi.serializers.checkout.ShippingAddressSerializer"
#     )
# 
# class BillingAddressCache(AbstractCheckoutAddressCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "billing_address", "oscarapi.serializers.checkout.BillingAddressSerializer"
#     )
# 
# class ShippingMethodCache(AbstractCheckoutCache):
#     serializer_class_path = pkgsettings.CHECKOUT_CACHE_SERIALIZERS.get(
#         "shipping_method", "oscarapicheckout.cache.ShippingMethodSerializer"
#     )


# Path: src/oscarapicheckout/tests/test_cache.py
from oscar.core.loading import get_model
from .base import BaseTest
from ..cache import (
    EmailAddressCache,
    ShippingAddressCache,
    BillingAddressCache,
    ShippingMethodCache,
)

            }
        )
        self.assertEqual(
            ShippingAddressCache(1).get(),
            {
                "first_name": "Bart",
                "last_name": "Simpson",
                "line1": "123 Evergreen Terrace",
                "line4": "Springfield",
                "state": "NY",
                "postcode": "10001",
                "country": Country.objects.get(iso_3166_1_a3="USA"),
            },
        )


class BillingAddressCacheTest(BaseTest):
    def test_cache(self):
        BillingAddressCache(1).set(
            {
                "first_name": "Lisa",
                "last_name": "Simpson",
                "line1": "123 Evergreen Terrace",
                "line4": "Springfield",
                "state": "NY",
                "postcode": "10001",
                "country": Country.objects.get(iso_3166_1_a3="USA"),
            }
        )
        self.assertEqual(

            BillingAddressCache(1).get(),