'Test serializer return data properly.'

def test_serializer_data(self):

    UserProfile.objects.create(user=self.user, name='test    name')
    data = UserReadOnlySerializer(self.user, configuration=self.config, context={'request': self.request}).data
    self.assertEqual(data['username'], self.user.username)
    self.assertEqual(data['name'], 'test    name')
    self.assertEqual(data['email'], self.user.email)
