def test_user_set(self): """If the user view is sent a POST request, it should attempt to update the user's info. """ request = self.factory.post('/news/user/asdf/', {'fake': 'data'}) with patch.object(views, 'update_user_task') as update_user_task: update_user_task.return_value = HttpResponse() views.user(request, 'asdf') update_user_task.assert_called_with(request, SET, data={'fake': 'data', 'token': 'asdf'})
def test_user_set(self): """If the user view is sent a POST request, it should attempt to update the user's info. """ subscriber = models.Subscriber(email="*****@*****.**", token="asdf") subscriber.save() request = self.factory.post("/news/user/asdf/", {"fake": "data"}) with patch.object(views, "update_user_task") as update_user_task: update_user_task.return_value = HttpResponse() views.user(request, "asdf") update_user_task.assert_called_with(request, SET)
def test_user_set(self): """If the user view is sent a POST request, it should attempt to update the user's info. """ request = self.factory.post('/news/user/asdf/', {'fake': 'data'}) with patch.object(views, 'update_user_task') as update_user_task: update_user_task.return_value = HttpResponse() views.user(request, 'asdf') update_user_task.assert_called_with(request, SET, { 'fake': 'data', 'token': 'asdf' })