# Path: api/serializers.py
# class CallResponseSerializer(serializers.Serializer):
#     """
#     Serializer for the call response view.
#     """
#     unique_key = serializers.CharField(max_length=255)
#     message_start_time = serializers.FloatField()
#     available = serializers.BooleanField(default=True)
# 
# class DeviceSerializer(TokenSerializer, SipUserIdSerializer):
#     """
#     Serializer for the device view post.
#     """
#     name = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     os_version = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     client_version = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     app = serializers.CharField(max_length=255)
#     sandbox = serializers.BooleanField(default=False)
#     remote_logging_id = serializers.CharField(max_length=255, allow_blank=True, required=False)
# 
# class IncomingCallSerializer(SipUserIdSerializer):
#     """
#     Serializer for the incoming call view.
#     """
#     caller_id = serializers.CharField(max_length=255, default='', allow_blank=True)
#     phonenumber = serializers.CharField(max_length=32, validators=[phone_number_validator])
#     call_id = serializers.CharField(max_length=255, default=None, allow_blank=True)
# 
# class SipUserIdSerializer(serializers.Serializer):
#     """
#     Base serializer for the sip_user_id field.
#     """
#     sip_user_id = serializers.IntegerField(max_value=999999999, min_value=int(1e8))
# 
# class TokenSerializer(serializers.Serializer):
#     """
#     Base serializer for the token field.
#     """
#     token = serializers.CharField(max_length=250, validators=[token_validator])


import time
from django.test import TestCase
from ..serializers import (
    CallResponseSerializer,
    DeviceSerializer,
    IncomingCallSerializer,
    SipUserIdSerializer,
    TokenSerializer,
)

        serializer = self.serializer(data=data)
        serializer.is_valid()

        sandbox = serializer.validated_data['sandbox']

        self.assertFalse(sandbox)

    def test_sandbox_value(self):
        """
        Test if sandbox is set to true when given.
        """
        data = {
            'sip_user_id': '123456789',
            'token': 'blaat',
            'app': 'com.org.name',
            'sandbox': 'True',
        }

        serializer = self.serializer(data=data)
        self.assertTrue(serializer.is_valid())

        sandbox = serializer.validated_data['sandbox']

        self.assertTrue(sandbox)


class TestCallResponseSerializer(TestCase):

    def setUp(self):

# Path: api/serializers.py
# class CallResponseSerializer(serializers.Serializer):
#     """
#     Serializer for the call response view.
#     """
#     unique_key = serializers.CharField(max_length=255)
#     message_start_time = serializers.FloatField()
#     available = serializers.BooleanField(default=True)
# 
# class DeviceSerializer(TokenSerializer, SipUserIdSerializer):
#     """
#     Serializer for the device view post.
#     """
#     name = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     os_version = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     client_version = serializers.CharField(max_length=255, allow_blank=True, required=False)
#     app = serializers.CharField(max_length=255)
#     sandbox = serializers.BooleanField(default=False)
#     remote_logging_id = serializers.CharField(max_length=255, allow_blank=True, required=False)
# 
# class IncomingCallSerializer(SipUserIdSerializer):
#     """
#     Serializer for the incoming call view.
#     """
#     caller_id = serializers.CharField(max_length=255, default='', allow_blank=True)
#     phonenumber = serializers.CharField(max_length=32, validators=[phone_number_validator])
#     call_id = serializers.CharField(max_length=255, default=None, allow_blank=True)
# 
# class SipUserIdSerializer(serializers.Serializer):
#     """
#     Base serializer for the sip_user_id field.
#     """
#     sip_user_id = serializers.IntegerField(max_value=999999999, min_value=int(1e8))
# 
# class TokenSerializer(serializers.Serializer):
#     """
#     Base serializer for the token field.
#     """
#     token = serializers.CharField(max_length=250, validators=[token_validator])


# Path: api/tests/test_serializers.py
import time
from django.test import TestCase
from ..serializers import (
    CallResponseSerializer,
    DeviceSerializer,
    IncomingCallSerializer,
    SipUserIdSerializer,
    TokenSerializer,
)


        serializer = self.serializer(data=data)
        serializer.is_valid()

        sandbox = serializer.validated_data['sandbox']

        self.assertFalse(sandbox)

    def test_sandbox_value(self):
        """
        Test if sandbox is set to true when given.
        """
        data = {
            'sip_user_id': '123456789',
            'token': 'blaat',
            'app': 'com.org.name',
            'sandbox': 'True',
        }

        serializer = self.serializer(data=data)
        self.assertTrue(serializer.is_valid())

        sandbox = serializer.validated_data['sandbox']

        self.assertTrue(sandbox)


class TestCallResponseSerializer(TestCase):

    def setUp(self):

        self.serializer = CallResponseSerializer