Example #1
0
 def test_delete_role(self):
     """Method to test deleting role."""
     role = InasafeRoleFactory.create()
     self.assertIsNotNone(role.id)
     role.delete()
     message = 'The role is not deleted.'
     self.assertIsNone(role.id, message)
Example #2
0
 def test_read_role(self):
     """Method to test reading role."""
     role_name = 'Testing Role'
     role = InasafeRoleFactory.create(name=role_name)
     message = 'The role name should be %s, but it gives %s' % (
         role_name, role.name)
     self.assertEqual(role_name, role.name, message)
Example #3
0
 def test_delete_role(self):
     """Method to test deleting role."""
     role = InasafeRoleFactory.create()
     self.assertIsNotNone(role.id)
     role.delete()
     message = 'The role is not deleted.'
     self.assertIsNone(role.id, message)
Example #4
0
 def test_read_role(self):
     """Method to test reading role."""
     role_name = 'Testing Role'
     role = InasafeRoleFactory.create(name=role_name)
     message = 'The role name should be %s, but it gives %s' % (role_name,
                                                                role.name)
     self.assertEqual(role_name, role.name, message)
Example #5
0
 def test_update_role(self):
     """Method to test updating role."""
     role = InasafeRoleFactory.create(name='Testing User')
     role_name = 'Updated Testing User'
     role.name = role_name
     role.save()
     message = 'The role name should be %s, but it gives %s' % (
         role_name, role.name)
     self.assertEqual(role_name, role.name, message)
Example #6
0
 def test_update_role(self):
     """Method to test updating role."""
     role = InasafeRoleFactory.create(name='Testing User')
     role_name = 'Updated Testing User'
     role.name = role_name
     role.save()
     message = 'The role name should be %s, but it gives %s' % (role_name,
                                                                role.name)
     self.assertEqual(role_name, role.name, message)
Example #7
0
 def test_create_role(self):
     """Method to test role creation."""
     role = InasafeRoleFactory.create()
     message = 'The role is not instantiated successfully.'
     self.assertIsNotNone(role.id, message)
Example #8
0
 def test_create_role(self):
     """Method to test role creation."""
     role = InasafeRoleFactory.create()
     message = 'The role is not instantiated successfully.'
     self.assertIsNotNone(role.id, message)