'Verify that the serializer only expands the user and team one level.'

def test_membership_serializer_expand_user_and_team(self):

    data = MembershipSerializer(self.team_membership, context={'expand': [u'team', u'user'], 'request': RequestFactory().get('/api/team/v0/team_membership')}).data
    username = self.user.username
    self.assertEqual(data['user'], {'url': ('http://testserver/api/user/v1/accounts/' + username), 'username': username, 'profile_image': {'image_url_full': 'http://testserver/static/default_500.png', 'image_url_large': 'http://testserver/static/default_120.png', 'image_url_medium': 'http://testserver/static/default_50.png', 'image_url_small': 'http://testserver/static/default_30.png', 'has_image': False}, 'account_privacy': 'private'})
    self.assertNotIn('membership', data['team'])
