def test_delete_role(self):
     """Method to test deleting role."""
     role = RoleFactory.create()
     self.assertIsNotNone(role.id)
     role.delete()
     message = 'The role is not deleted.'
     self.assertIsNone(role.id, message)
Beispiel #2
0
 def test_delete_role(self):
     """Method to test deleting role."""
     role = RoleFactory.create()
     self.assertIsNotNone(role.id)
     role.delete()
     message = 'The role is not deleted.'
     self.assertIsNone(role.id, message)
Beispiel #3
0
 def test_read_role(self):
     """Method to test reading role."""
     role_name = 'Testing Role'
     role = RoleFactory.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)
Beispiel #4
0
 def test_read_role(self):
     """Method to test reading role."""
     role_name = 'Testing Role'
     role = RoleFactory.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)
Beispiel #5
0
 def test_update_role(self):
     """Method to test updating role."""
     role = RoleFactory.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)
 def test_update_role(self):
     """Method to test updating role."""
     role = RoleFactory.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)
    def test_read_role(self):
        """Method to test reading role."""
        for i in range(3):
            RoleFactory(__sequence=i)

        for i in range(3):
            role_name = 'Role %s' % i
            role_badge = 'path/to/badge/role%s' % i

            role = Role.objects.get(pk=i)
            message = 'The role name should be %s, but it gives %s' % (
                role_name, role.name)
            self.assertEqual(role_name, role.name, message)
            message = 'The role badge should be %s, but it gives %s' % (
                role_badge, role.badge)
            self.assertEqual(role_badge, role.badge, message)
Beispiel #8
0
 def test_create_role(self):
     """Method to test role creation."""
     role = RoleFactory.create()
     message = 'The role is not instantiated successfully.'
     self.assertIsNotNone(role.id, message)
 def test_create_role(self):
     """Method to test role creation."""
     role = RoleFactory.create()
     message = 'The role is not instantiated successfully.'
     self.assertIsNotNone(role.id, message)