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
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)
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