Ejemplo n.º 1
0
    def setUp(self):
        """setup the test
        """
        super(SequenceTester, self).setUp()

        # create a test project, user and a couple of shots
        from stalker import Type
        self.project_type = Type(
            name="Test Project Type",
            code='test',
            target_entity_type='Project',
        )
        from stalker.db.session import DBSession
        DBSession.add(self.project_type)

        # create a repository
        self.repository_type = Type(
            name="Test Type",
            code='test',
            target_entity_type='Repository'
        )
        DBSession.add(self.repository_type)

        from stalker import Repository
        self.test_repository = Repository(
            name="Test Repository",
            type=self.repository_type,
        )
        DBSession.add(self.test_repository)

        # create projects
        from stalker import Project
        self.test_project = Project(
            name="Test Project 1",
            code='tp1',
            type=self.project_type,
            repository=self.test_repository,
        )
        DBSession.add(self.test_project)

        self.test_project2 = Project(
            name="Test Project 2",
            code='tp2',
            type=self.project_type,
            repository=self.test_repository,
        )
        DBSession.add(self.test_project2)

        # the parameters
        self.kwargs = {
            "name": "Test Sequence",
            'code': 'tseq',
            "description": "A test sequence",
            "project": self.test_project,
        }

        # the test sequence
        from stalker import Sequence
        self.test_sequence = Sequence(**self.kwargs)
        DBSession.commit()
Ejemplo n.º 2
0
    def setUp(self):
        """setup the test
        """
        super(LinkTester, self).setUp()

        # create a mock LinkType object
        from stalker import db, Type
        self.test_link_type1 = Type(
            name='Test Type 1',
            code='test type1',
            target_entity_type=Link,
        )
        db.DBSession.add(self.test_link_type1)
        self.test_link_type2 = Type(
            name='Test Type 2',
            code='test type2',
            target_entity_type=Link,
        )
        db.DBSession.add(self.test_link_type2)

        self.kwargs = {
            'name': 'An Image Link',
            'full_path': 'C:/A_NEW_PROJECT/td/dsdf/'
            '22-fdfffsd-32342-dsf2332-dsfd-3.exr',
            'original_filename': 'this_is_an_image.jpg',
            'type': self.test_link_type1
        }

        self.test_link = Link(**self.kwargs)
        db.DBSession.add(self.test_link)
        db.DBSession.commit()
Ejemplo n.º 3
0
    def setUp(self):
        """setup the test
        """
        # create a user
        self.test_user = User(
            name='Test User',
            login='******',
            email='*****@*****.**',
            password='******',
        )

        # vacation type
        self.personal_vacation = Type(
            name='Personal',
            code='PERS',
            target_entity_type='Vacation'
        )

        self.studio_vacation = Type(
            name='Studio Wide',
            code='STD',
            target_entity_type='Vacation'
        )

        self.kwargs = {
            'user': self.test_user,
            'type': self.personal_vacation,
            'start': datetime.datetime(2013, 6, 6, 10, 0),
            'end': datetime.datetime(2013, 6, 10, 19, 0)
        }

        self.test_vacation = Vacation(**self.kwargs)
Ejemplo n.º 4
0
    def setUp(self):
        """setup the test
        """
        super(VacationTestCase, self).setUp()

        # create a user
        from stalker import User
        self.test_user = User(
            name='Test User',
            login='******',
            email='*****@*****.**',
            password='******',
        )

        # vacation type
        from stalker import Type
        self.personal_vacation = Type(name='Personal',
                                      code='PERS',
                                      target_entity_type='Vacation')

        self.studio_vacation = Type(name='Studio Wide',
                                    code='STD',
                                    target_entity_type='Vacation')

        import datetime
        import pytz
        self.kwargs = {
            'user': self.test_user,
            'type': self.personal_vacation,
            'start': datetime.datetime(2013, 6, 6, 10, 0, tzinfo=pytz.utc),
            'end': datetime.datetime(2013, 6, 10, 19, 0, tzinfo=pytz.utc)
        }

        self.test_vacation = Vacation(**self.kwargs)
Ejemplo n.º 5
0
    def setUp(self):
        """setting up the test
        """
        super(PageTester, self).setUp()

        # create a repository
        from stalker import Type
        self.repository_type = Type(name="Test Repository Type",
                                    code='test_repo',
                                    target_entity_type='Repository')

        from stalker import Repository
        self.test_repository = Repository(
            name="Test Repository",
            code="TR",
            type=self.repository_type,
        )

        # statuses
        from stalker import Status
        self.status1 = Status(name="Status1", code="STS1")
        self.status2 = Status(name="Status2", code="STS2")
        self.status3 = Status(name="Status3", code="STS3")

        # project status list
        from stalker import StatusList
        self.project_status_list = StatusList(name="Project Status List",
                                              statuses=[
                                                  self.status1,
                                                  self.status2,
                                                  self.status3,
                                              ],
                                              target_entity_type='Project')

        # project type
        self.test_project_type = Type(
            name="Test Project Type",
            code='testproj',
            target_entity_type='Project',
        )

        # create projects
        from stalker import Project
        self.test_project1 = Project(
            name="Test Project 1",
            code='tp1',
            type=self.test_project_type,
            status_list=self.project_status_list,
            repository=self.test_repository,
        )

        self.kwargs = {
            'title': 'Test Page Title',
            'content': 'Test content',
            'project': self.test_project1
        }

        self.test_page = Page(**self.kwargs)
Ejemplo n.º 6
0
    def setUp(self):
        """setup the test
        """

        # create a repository
        self.repository_type = Type(name="Test Repository Type",
                                    code='testproj',
                                    target_entity_type=Repository)

        self.test_repository = Repository(
            name="Test Repository",
            type=self.repository_type,
        )

        # statuses
        self.status1 = Status(name="Status1", code="STS1")
        self.status2 = Status(name="Status2", code="STS2")
        self.status3 = Status(name="Status3", code="STS3")

        # project status list
        self.project_status_list = StatusList(name="Project Status List",
                                              statuses=[
                                                  self.status1,
                                                  self.status2,
                                                  self.status3,
                                              ],
                                              target_entity_type=Project)

        # project type
        self.test_project_type = Type(
            name="Test Project Type",
            code='testproj',
            target_entity_type=Project,
        )

        # create projects
        self.test_project1 = Project(
            name="Test Project 1",
            code='tp1',
            type=self.test_project_type,
            status_list=self.project_status_list,
            repository=self.test_repository,
        )

        self.test_project2 = Project(
            name="Test Project 2",
            code='tp2',
            type=self.test_project_type,
            status_list=self.project_status_list,
            repository=self.test_repository,
        )

        self.kwargs = {
            "name": "Test Class",
            "project": self.test_project1,
        }

        self.test_foo_obj = ProjMixClass(**self.kwargs)
Ejemplo n.º 7
0
    def setUp(self):
        """setting up the tests
        """
        super(StructureTester, self).setUp()

        from stalker import db, Type
        vers_type = Type(name="Version",
                         code='vers',
                         target_entity_type="FilenameTemplate")
        db.DBSession.add(vers_type)

        ref_type = Type(name="Reference",
                        code='ref',
                        target_entity_type="FilenameTemplate")
        db.DBSession.add(ref_type)
        db.DBSession.commit()

        # type templates
        from stalker import FilenameTemplate
        self.asset_template = FilenameTemplate(name="Test Asset Template",
                                               target_entity_type="Asset",
                                               type=vers_type)

        self.shot_template = FilenameTemplate(name="Test Shot Template",
                                              target_entity_type="Shot",
                                              type=vers_type)

        self.reference_template = FilenameTemplate(
            name="Test Reference Template",
            target_entity_type="Link",
            type=ref_type)

        self.test_templates = [
            self.asset_template, self.shot_template, self.reference_template
        ]

        self.test_templates2 = [self.asset_template]

        self.custom_template = "a custom template"

        self.test_type = Type(
            name="Commercial Structure",
            code='comm',
            target_entity_type='Structure',
        )

        # keyword arguments
        self.kwargs = {
            "name": "Test Structure",
            "description": "This is a test structure",
            "templates": self.test_templates,
            "custom_template": self.custom_template,
            "type": self.test_type,
        }
        self.test_structure = Structure(**self.kwargs)
        db.DBSession.add(self.test_structure)
        db.DBSession.commit()
Ejemplo n.º 8
0
def create_ticket_statuses():
    """creates the default ticket statuses
    """
    from stalker import defaults, User

    # create as admin
    admin = User.query.filter(User.login == defaults.admin_name).first()

    # create statuses for Tickets
    ticket_names = defaults.ticket_status_names
    ticket_codes = defaults.ticket_status_codes
    create_entity_statuses('Ticket', ticket_names, ticket_codes, admin)

    # Again I hate doing this in this way
    from stalker import Type

    types = Type.query \
        .filter_by(target_entity_type="Ticket") \
        .all()
    t_names = [t.name for t in types]

    # create Ticket Types
    logger.debug("Creating Ticket Types")
    from stalker.db.session import DBSession
    if 'Defect' not in t_names:
        ticket_type_1 = Type(
            name='Defect',
            code='Defect',
            target_entity_type='Ticket',
            created_by=admin,
            updated_by=admin
        )
        DBSession.add(ticket_type_1)

    if 'Enhancement' not in t_names:
        ticket_type_2 = Type(
            name='Enhancement',
            code='Enhancement',
            target_entity_type='Ticket',
            created_by=admin,
            updated_by=admin
        )
        DBSession.add(ticket_type_2)

    from sqlalchemy.exc import IntegrityError
    try:
        DBSession.commit()
    except IntegrityError:
        DBSession.rollback()
        logger.debug("Ticket Types are already in the database!")
    else:
        # DBSession.flush()
        logger.debug("Ticket Types are created successfully")
Ejemplo n.º 9
0
    def setUp(self):
        """setting up the tests
        """

        vers_type = Type(name="Version",
                         code='vers',
                         target_entity_type="FilenameTemplate")

        ref_type = Type(name="Reference",
                        code='ref',
                        target_entity_type="FilenameTemplate")

        # type templates
        self.asset_template = FilenameTemplate(name="Test Asset Template",
                                               target_entity_type="Asset",
                                               type=vers_type)

        self.shot_template = FilenameTemplate(name="Test Shot Template",
                                              target_entity_type="Shot",
                                              type=vers_type)

        self.reference_template = FilenameTemplate(
            name="Test Reference Template",
            target_entity_type="Link",
            type=ref_type)

        self.test_templates = [
            self.asset_template, self.shot_template, self.reference_template
        ]

        self.test_templates2 = [self.asset_template]

        self.custom_template = "a custom template"

        self.test_type = Type(
            name="Commercial Structure",
            code='comm',
            target_entity_type=Structure,
        )

        # keyword arguments
        self.kwargs = {
            "name": "Test Structure",
            "description": "This is a test structure",
            "templates": self.test_templates,
            "custom_template": self.custom_template,
            "type": self.test_type,
        }
        self.test_structure = Structure(**self.kwargs)
Ejemplo n.º 10
0
    def test_TaskMixin_initialization(self):
        """testing if the TaskMixin part is initialized correctly
        """

        commercial_project_type = Type(
            name="Commercial",
            code='comm',
            target_entity_type=Project,
        )

        new_project = Project(
            name="Commercial",
            code='COM',
            type=commercial_project_type,
            status_list=self.project_status_list,
            repository=self.repository,
        )

        character_asset_type = Type(
            name="Character",
            code='char',
            target_entity_type=Asset
        )

        new_asset = Asset(
            name="test asset",
            type=character_asset_type,
            code="tstasset",
            project=new_project,
            responsible=[self.test_user1]
        )

        task1 = Task(
            name="Modeling",
            parent=new_asset
        )

        task2 = Task(
            name="Lighting",
            parent=new_asset
        )

        tasks = [task1, task2]

        self.assertEqual(
            sorted(new_asset.tasks, key=lambda x: x.name),
            sorted(tasks, key=lambda x: x.name)
        )
Ejemplo n.º 11
0
    def loads(self, data):
        """Decodes Stalker data

        :param data:
        :return:
        """
        from stalker.db.session import DBSession
        from stalker import Asset, Task, Shot, Sequence, Version, Type

        if isinstance(data, str):
            data = json.loads(data)

        # get the entity_type
        entity_type = data['entity_type']

        # set default entity class to Task
        entity_class = Task
        if entity_type == 'Asset':
            entity_class = Asset
        elif entity_type == 'Shot':
            entity_class = Shot
            # this is a bug
            data['sequences'] = []
        elif entity_type == 'Sequence':
            entity_class = Sequence

        version_data = data['versions']
        data['versions'] = []
        # get the type
        if 'type' in data:
            type_data = data['type']
            if type_data:
                type_name = type_data['name']
                type_ = Type.query.filter(Type.name == type_name).first()
                if not type_:
                    # create a Type
                    type_ = Type(**type_data)
                data['type'] = type_

        data['project'] = self.project
        entity = entity_class(**data)
        DBSession.add(entity)
        DBSession.commit()

        # create Versions
        if version_data:
            for v_data in version_data:
                # get Version info
                v_data['task'] = entity
                v = Version(**v_data)
                # update version_number
                v.version_number = v_data['version_number']
                v.is_published = v_data['is_published']

        # for each child task call a new StalkerEntityDecoder
        for t in data['tasks']:
            child_task = self.loads(t)
            entity.tasks.append(child_task)

        return entity
Ejemplo n.º 12
0
    def test_update_entity_method_is_working_properly_with_post(self):
        """testing if the POST: /api/types/{id} view is working properly
        """
        from stalker import db, Type
        test_type = Type(name='Test Type',
                         code='TT',
                         description='A test type',
                         target_entity_type='Project',
                         created_by=self.admin)
        db.DBSession.add(test_type)
        db.DBSession.commit()

        self.admin_login()
        response = self.test_app.post('/api/types/%s' % test_type.id,
                                      params={
                                          'description': 'New description',
                                          'name': 'New Name',
                                          'code': 'New Code'
                                      },
                                      status=200)

        test_type_db = Type.query.get(test_type.id)
        self.assertEqual(test_type_db.name, 'New Name')
        self.assertEqual(test_type_db.code, 'New Code')
        self.assertEqual(test_type_db.description, 'New description')
Ejemplo n.º 13
0
    def test_equality(self):
        """testing the equality operator
        """
        new_type2 = Type(**self.kwargs)

        self.kwargs["target_entity_type"] = "Asset"
        new_type3 = Type(**self.kwargs)

        self.kwargs["name"] = "a different type"
        self.kwargs["description"] = "this is a different type"
        new_type4 = Type(**self.kwargs)

        self.assertTrue(self.test_type == new_type2)
        self.assertFalse(self.test_type == new_type3)
        self.assertFalse(self.test_type == new_type4)
        self.assertFalse(self.test_type == self.entity1)
Ejemplo n.º 14
0
    def test_ReferenceMixin_initialization(self):
        """testing if the ReferenceMixin part is initialized correctly
        """
        from stalker import Link, Type
        link_type_1 = Type(
            name="Image",
            code='image',
            target_entity_type="Link"
        )

        link1 = Link(
            name="Artwork 1",
            full_path="/mnt/M/JOBs/TEST_PROJECT",
            filename="a.jpg",
            type=link_type_1
        )

        link2 = Link(
            name="Artwork 2",
            full_path="/mnt/M/JOBs/TEST_PROJECT",
            filename="b.jbg",
            type=link_type_1
        )

        references = [link1, link2]

        self.kwargs["code"] = "SH12314"
        self.kwargs["references"] = references

        from stalker import Asset
        new_asset = Asset(**self.kwargs)

        assert new_asset.references == references
Ejemplo n.º 15
0
    def test_ProjectMixin_initialization(self):
        """testing if the ProjectMixin part is initialized correctly
        """
        from stalker import Status, StatusList
        status1 = Status(name="On Hold", code="OH")

        project_status_list = StatusList(
            name="Project Statuses", statuses=[status1],
            target_entity_type='Project'
        )

        from stalker import Type
        project_type = Type(
            name="Commercial",
            code='comm',
            target_entity_type='Project'
        )

        from stalker import Project
        new_project = Project(
            name="Test Project",
            code='tp',
            status=project_status_list[0],
            status_list=project_status_list,
            type=project_type,
            repository=self.test_repository
        )

        from stalker import Sequence
        self.kwargs["project"] = new_project
        new_sequence = Sequence(**self.kwargs)
        self.assertEqual(new_sequence.project, new_project)
Ejemplo n.º 16
0
    def test_ReferenceMixin_initialization(self):
        """testing if the ReferenceMixin part is initialized correctly
        """
        from stalker import Type, Link, Sequence
        link_type_1 = Type(
            name="Image",
            code='image',
            target_entity_type="Link"
        )

        link1 = Link(
            name="Artwork 1",
            full_path="/mnt/M/JOBs/TEST_PROJECT",
            filename="a.jpg",
            type=link_type_1
        )
        link2 = Link(
            name="Artwork 2",
            full_path="/mnt/M/JOBs/TEST_PROJECT",
            filename="b.jbg",
            type=link_type_1
        )
        references = [link1, link2]
        self.kwargs["references"] = references
        new_sequence = Sequence(**self.kwargs)
        self.assertEqual(new_sequence.references, references)
Ejemplo n.º 17
0
    def test_update_entity_method_is_working_properly(self):
        """testing if the update_entity() method is working properly
        """
        from stalker import db, Type
        test_type = Type(name='Test Type',
                         code='TT',
                         description='A test type',
                         target_entity_type='Project',
                         created_by=self.admin)
        db.DBSession.add(test_type)
        db.DBSession.commit()

        from stalker_pyramid.testing import DummyRequest, DummyMultiDict
        request = DummyRequest()
        request.matchdict['id'] = test_type.id
        request.params = DummyMultiDict()
        request.params['description'] = 'New description'
        request.params['name'] = 'New Name'
        request.params['code'] = 'New Code'

        self.patch_logged_in_user(request)
        type_view = type.TypeViews(request)
        response = type_view.update_entity()

        test_type_db = Type.query.get(test_type.id)
        self.assertEqual(test_type_db.name, 'New Name')
        self.assertEqual(test_type_db.code, 'New Code')
        self.assertEqual(test_type_db.description, 'New description')
Ejemplo n.º 18
0
    def test_inequality(self):
        """testing the inequality operator
        """
        new_type2 = Type(**self.kwargs)

        self.kwargs["target_entity_type"] = "Asset"
        new_type3 = Type(**self.kwargs)

        self.kwargs["name"] = "a different type"
        self.kwargs["description"] = "this is a different type"
        new_type4 = Type(**self.kwargs)

        assert not self.test_type != new_type2
        assert self.test_type != new_type3
        assert self.test_type != new_type4
        assert self.test_type != self.entity1
Ejemplo n.º 19
0
    def test_TaskMixin_initialization(self):
        """testing if the TaskMixin part is initialized correctly
        """
        from stalker import Type, Project, Asset, Task
        commercial_project_type = Type(
            name="Commercial",
            code='comm',
            target_entity_type='Project',
        )

        new_project = Project(
            name="Commercial",
            code='COM',
            type=commercial_project_type,
            repository=self.repository,
        )

        character_asset_type = Type(
            name="Character",
            code='char',
            target_entity_type='Asset'
        )

        new_asset = Asset(
            name="test asset",
            type=character_asset_type,
            code="tstasset",
            project=new_project,
            responsible=[self.test_user1]
        )

        task1 = Task(
            name="Modeling",
            parent=new_asset
        )

        task2 = Task(
            name="Lighting",
            parent=new_asset
        )

        tasks = [task1, task2]

        assert \
            sorted(new_asset.tasks, key=lambda x: x.name) == \
            sorted(tasks, key=lambda x: x.name)
Ejemplo n.º 20
0
    def test_target_entity_type_argument_accepts_Python_classes(self):
        """testing if target_entity_type argument is given as a Python class
        will be converted to a string
        """
        from stalker.models.asset import Asset

        self.kwargs["target_entity_type"] = Asset
        new_type = Type(**self.kwargs)
        assert new_type.target_entity_type == "Asset"
Ejemplo n.º 21
0
    def test_target_entity_type_argument_can_not_be_empty_string(self):
        """testing if a ValueError will be raised when the target_entity_type
        argument is an empty string
        """
        self.kwargs["target_entity_type"] = ""
        with pytest.raises(ValueError) as cm:
            Type(**self.kwargs)

        assert str(cm.value) == 'Type.target_entity_type can not be empty'
Ejemplo n.º 22
0
    def test_target_entity_type_argument_can_not_be_None(self):
        """testing if a TypeError will be raised when the target_entity_type
        argument is None
        """
        self.kwargs["target_entity_type"] = None
        with pytest.raises(TypeError) as cm:
            Type(**self.kwargs)

        assert str(cm.value) == 'Type.target_entity_type can not be None'
Ejemplo n.º 23
0
    def test_target_entity_type_argument_can_not_be_skipped(self):
        """testing if a TypeError will be raised when the created Type doesn't
        have any target_entity_type
        """
        self.kwargs.pop("target_entity_type")
        with pytest.raises(TypeError) as cm:
            Type(**self.kwargs)

        assert str(cm.value) == 'Type.target_entity_type can not be None'
Ejemplo n.º 24
0
    def test_target_entity_type_argument_can_not_be_empty_string(self):
        """testing if a ValueError will be raised when the target_entity_type
        argument is an empty string
        """
        self.kwargs["target_entity_type"] = ""
        with self.assertRaises(ValueError) as cm:
            Type(**self.kwargs)

        self.assertEqual(str(cm.exception),
                         'Type.target_entity_type can not be empty')
Ejemplo n.º 25
0
    def test_target_entity_type_argument_can_not_be_skipped(self):
        """testing if a TypeError will be raised when the created Type doesn't
        have any target_entity_type
        """
        self.kwargs.pop("target_entity_type")
        with self.assertRaises(TypeError) as cm:
            Type(**self.kwargs)

        self.assertEqual(str(cm.exception),
                         'Type.target_entity_type can not be None')
Ejemplo n.º 26
0
    def test_target_entity_type_argument_can_not_be_None(self):
        """testing if a TypeError will be raised when the target_entity_type
        argument is None
        """
        self.kwargs["target_entity_type"] = None
        with self.assertRaises(TypeError) as cm:
            Type(**self.kwargs)

        self.assertEqual(str(cm.exception),
                         'Type.target_entity_type can not be None')
Ejemplo n.º 27
0
    def test_TaskMixin_initialization(self):
        """testing if the TaskMixin part is initialized correctly
        """
        from stalker import StatusList
        project_status_list = \
            StatusList.query\
                .filter(StatusList.target_entity_type=='Project').first()

        from stalker import Type
        project_type = Type(
            name="Commercial",
            code='comm',
            target_entity_type='Project'
        )

        from stalker import Project
        new_project = Project(
            name="Commercial1",
            code='comm1',
            status_list=project_status_list,
            type=project_type,
            repository=self.test_repository,
        )
        from stalker.db.session import DBSession
        DBSession.add(new_project)
        DBSession.commit()

        self.kwargs['project'] = new_project
        self.kwargs['code'] = "SH12314"

        from stalker import Task
        new_shot = Shot(**self.kwargs)

        task1 = Task(
            name="Modeling", status=0,
            project=new_project,
            parent=new_shot,
        )

        task2 = Task(
            name="Lighting",
            status=0,
            project=new_project,
            parent=new_shot,
        )

        tasks = [task1, task2]

        assert \
            sorted(new_shot.tasks, key=lambda x: x.name) == \
            sorted(tasks, key=lambda x: x.name)
Ejemplo n.º 28
0
def create_ticket_types():
    """Creates the extra ticket types
    """
    # create Review ticket type
    review = Type.query.filter_by(name='Review').first()
    if not review:
        # create the review type for Tickets
        review = Type(target_entity_type='Ticket',
                      name='Review',
                      code='Review')

    # Warning! Not using scoped_session here, it is the plain old session
    DBSession.add(review)
    DBSession.commit()
Ejemplo n.º 29
0
    def test_TaskableEntity_initialization(self):
        """testing if the TaskableEntity part is initialized correctly
        """
        from stalker import Status, StatusList
        status1 = Status(name="On Hold", code="OH")

        project_status_list = StatusList(
            name="Project Statuses", statuses=[status1],
            target_entity_type='Project',
        )

        from stalker import Type, Project, Sequence, Task
        project_type = Type(
            name="Commercial",
            code='comm',
            target_entity_type='Project'
        )

        new_project = Project(
            name="Commercial",
            code='comm',
            status_list=project_status_list,
            type=project_type,
            repository=self.test_repository,
        )

        self.kwargs["new_project"] = new_project

        new_sequence = Sequence(**self.kwargs)

        task1 = Task(
            name="Modeling",
            status=0,
            project=new_project,
            parent=new_sequence,
        )

        task2 = Task(
            name="Lighting",
            status=0,
            project=new_project,
            parent=new_sequence,
        )

        tasks = [task1, task2]

        self.assertEqual(
            sorted(new_sequence.tasks, key=lambda x: x.name),
            sorted(tasks, key=lambda x: x.name)
        )
Ejemplo n.º 30
0
    def setUp(self):
        """set up the test
        """
        self.kwargs = {
            "name": "test type",
            'code': 'test',
            "description": "this is a test type",
            "target_entity_type": "SimpleEntity"
        }

        self.test_type = Type(**self.kwargs)

        # create another Entity with the same name of the
        # test_type for __eq__ and __ne__ tests
        self.entity1 = Entity(**self.kwargs)