Ejemplo n.º 1
0
 def test_check_curate_is_resource_return_except(self):
     # Act
     custom_resource = CustomResource(type=CUSTOM_RESOURCE_TYPE.RESOURCE.value)
     # Assert
     with mock.patch.object(settings, "INSTALLED_APPS", ["core_curate_app"]):
         with self.assertRaises(exceptions.ModelError):
             custom_resource_api._check_curate(custom_resource)
Ejemplo n.º 2
0
 def test_check_curate_is_not_resource_return_none(self):
     # Act
     custom_resource = CustomResource()
     # Assert
     with mock.patch.object(settings, "INSTALLED_APPS",
                            ["core_curate_app"]):
         self.assertIsNone(
             custom_resource_api._check_curate(custom_resource))
Ejemplo n.º 3
0
 def test_check_curate_is_resource_with_all_return_none(self):
     # Act
     custom_resource = CustomResource(
         type=CUSTOM_RESOURCE_TYPE.RESOURCE.value,
         role_type="role_type",
         role_choice="role_choice",
     )
     # Assert
     with mock.patch.object(settings, "INSTALLED_APPS", ["core_curate_app"]):
         self.assertIsNone(custom_resource_api._check_curate(custom_resource))
Ejemplo n.º 4
0
 def test_check_curate_core_curate_app_not_installed_return_none(self):
     # Act
     custom_resource = CustomResource()
     # Assert
     self.assertIsNone(custom_resource_api._check_curate(custom_resource))