<s> import datetime <EOL> from decimal import Decimal <EOL> import unittest <EOL> import uuid <EOL> from restless . serializers import JSONSerializer <EOL> class JSONSerializerTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( JSONSerializerTestCase , self ) . setUp ( ) <EOL> self . serializer = JSONSerializer ( ) <EOL> self . dict_data = { <EOL> '<STR_LIT:hello>' : '<STR_LIT>' , <EOL> '<STR_LIT:abc>' : <NUM_LIT> , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : datetime . datetime ( <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT:30> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT:15> ) , <EOL> '<STR_LIT>' : Decimal ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : uuid . uuid4 ( ) <EOL> } , <EOL> } <EOL> def test_serialize ( self ) : <EOL> body = self . serializer . serialize ( self . dict_data ) <EOL> self . assertTrue ( '<STR_LIT>' in body ) <EOL> self . assertTrue ( '<STR_LIT>' in body ) <EOL> self . assertTrue ( '<STR_LIT>' in body ) <EOL> self . assertTrue ( '<STR_LIT>' in body ) <EOL> def test_deserialize ( self ) : <EOL> self . assertEqual ( self . serializer . deserialize ( '<STR_LIT>' ) , { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } ) </s>
