#NEWLINE# def test_deserialize_json( self ) : #NEWLINE# #INDENT# beatles = Band . from_json ( '{"pk": 9, "albums": [], "name": "The Beatles", "members": [{"pk": null, "name": "John Lennon", "band": null}, {"pk": null, "name": "Paul McCartney", "band": null}]}' ) #NEWLINE# self . assertEqual ( 9 , beatles . id ) #NEWLINE# self . assertEqual ( 'The Beatles' , beatles . name ) #NEWLINE# self . assertEqual ( 2 , beatles . members . count ( ) ) #NEWLINE# self . assertEqual ( BandMember , beatles . members . all ( ) [ 0 ] . __class__ )