def test_a_user_can_assign_a_blob_if_owner(self):
     data = {
         "document_id[]": [str(self.fixture.blob_1.id)],
         "workspace_id[]": [str(self.fixture.workspace_2.id)],
     }
     request = self.factory.post("core_main_assign_blob_workspace", data)
     request.user = self.user1
     response = AssignView.as_view(api=blob_api)(request)
     self.assertEqual(response.status_code, 200)
 def test_an_anonymous_user_can_not_assign_a_public_workspace_blob(self):
     data = {
         "document_id[]": [str(self.fixture.blob_public_workspace.id)],
         "workspace_id[]": [str(self.fixture.workspace_2.id)],
     }
     request = self.factory.post("core_main_assign_blob_workspace", data)
     request.user = self.anonymous
     response = AssignView.as_view(api=blob_api)(request)
     self.assertEqual(response.status_code, 302)
     self.assertTrue(response.url.startswith(LOGIN_URL))