Ejemplo n.º 1
0
 def generate_fixture_project(self, name="Cosmos Landromat"):
     self.project = Project.create(name=name,
                                   project_status_id=self.open_status.id)
     self.project_id = self.project.id
     self.project.update(
         {"file_tree": file_tree_service.get_tree_from_file("simple")})
     return self.project
Ejemplo n.º 2
0
Archivo: base.py Proyecto: mathbou/zou
 def generate_fixture_project_no_preview_tree(self):
     self.project_no_preview_tree = Project.create(
         name="Agent 327", project_status_id=self.open_status.id
     )
     self.project_no_preview_tree.update(
         {"file_tree": file_tree_service.get_tree_from_file("no_preview")}
     )
Ejemplo n.º 3
0
Archivo: base.py Proyecto: mathbou/zou
 def generate_fixture_project_standard(self):
     self.project_standard = Project.create(
         name="Big Buck Bunny", project_status_id=self.open_status.id
     )
     self.project_standard.update(
         {"file_tree": file_tree_service.get_tree_from_file("default")}
     )
Ejemplo n.º 4
0
 def test_get_instance(self):
     project = Project.create(name="Test")
     project_again = base_service.get_instance(Project, project.id,
                                               ProjectNotFoundException)
     self.assertEquals(project.id, project_again.id)
     project.delete()
     with pytest.raises(ProjectNotFoundException):
         base_service.get_instance(Project, project.id,
                                   ProjectNotFoundException)
Ejemplo n.º 5
0
    def setUp(self):
        super(QueryTestCase, self).setUp()
        self.generate_fixture_project_status()
        self.generate_fixture_project()

        self.project_id = self.project.id
        project = Project.create(name="Kitchen",
                                 project_status_id=self.open_status.id)
        self.project2_id = project.id

        self.generate_fixture_asset_type()
        self.generate_fixture_asset_types()
        self.generate_fixture_asset("Asset 1")
        self.generate_fixture_asset("Asset 2")
        self.generate_fixture_asset("Asset 3")
        self.generate_fixture_asset_character("Asset char 1")
        self.generate_fixture_asset_character("Asset char 2")
Ejemplo n.º 6
0
    def import_row(self, row):
        name = row["Name"]
        project_status_name = row["Status"]

        self.add_to_cache_if_absent(self.project_statuses,
                                    project_info.get_or_create_status,
                                    project_status_name)
        project_status_id = self.get_id_from_cache(self.project_statuses,
                                                   project_status_name)

        try:
            project = Project.create(name=name,
                                     project_status_id=project_status_id)
        except IntegrityError:
            project = Project.get_by(name=name)

        return project
Ejemplo n.º 7
0
 def generate_fixture_project_closed(self):
     self.project_closed = Project.create(
         name="Old Project", project_status_id=self.closed_status.id)