示例#1
0
文件: views.py 项目: Y16v/PayDevs
 def post(self, *args, **kwargs):
     self.get_user_interactor.set_params(**kwargs).execute()
     user = self.auth(**kwargs)
     body = UserSerializer.serialize(user)
     body.update({'token': user.token})
     status = StatusCodes.CREATED
     return body, status
示例#2
0
    def test_user_serializer(self):
        user = User(id=1, username='******', email='*****@*****.**', is_active=True,
                    is_staff=False)
        serilalizer = {
            'id': 1,
            'username': '******',
            'email': '*****@*****.**',
            'is_active': True,
            'is_staff': False,
        }

        self.assertDictEqual(UserSerializer.serialize(user), serilalizer)
示例#3
0
文件: views.py 项目: Y16v/PayDevs
 def get(self, *args, **kwargs):
     user = self.get_user_interactor.set_params(
         id=kwargs['logged_id']).execute()
     body = UserSerializer.serialize(user)
     status = StatusCodes.OK
     return body, status