Esempio n. 1
0
 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'})
Esempio n. 2
0
    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)
Esempio n. 3
0
 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'
         })