コード例 #1
0
ファイル: TestFaculty.py プロジェクト: tfausak/class
    def test_addRetrieveConference(self):
        c = F.addConference("My Conference", "4/1/2010", "Chicago")

        self.assert_(c.name == "My Conference" and c.date == "4/1/2010" and c.location == "Chicago")

        key = c.key()

        c = db.get(key)

        self.assert_(c.name == "My Conference" and c.date == "4/1/2010" and c.location == "Chicago")
コード例 #2
0
ファイル: Import.py プロジェクト: saadfsti/class
		def put_conferences(conferences):
			"""
			makes DB Conference objects, associating them with their person
		
			Keyword arguments:
			person_handle -- person that owns these courses
			conferences -- list of courses to associate person with
		
			no return
			"""
			l = []
			for conference in conferences:
				conf = conference.find('conference')
				date = get_text(conf.find('date'))
				name = get_text(conf.find('name'))
				conf_location = get_text(conf.find('conf_location'))
				presentation_title = get_text(conference.find('presentation_title'))
				conference = Faculty3.addConference(name, date, conf_location)
				l.append(Faculty3.addPresentation(presentation_title, conference))
			
			return l
コード例 #3
0
        def put_conferences(conferences):
            """
			makes DB Conference objects, associating them with their person
		
			Keyword arguments:
			person_handle -- person that owns these courses
			conferences -- list of courses to associate person with
		
			no return
			"""
            l = []
            for conference in conferences:
                conf = conference.find('conference')
                date = get_text(conf.find('date'))
                name = get_text(conf.find('name'))
                conf_location = get_text(conf.find('conf_location'))
                presentation_title = get_text(
                    conference.find('presentation_title'))
                conference = Faculty3.addConference(name, date, conf_location)
                l.append(
                    Faculty3.addPresentation(presentation_title, conference))

            return l
コード例 #4
0
ファイル: TestFaculty.py プロジェクト: tfausak/class
    def test_addRetrievePresentation(self):
        c = F.addConference("My Presentation Conference", "4/1/2010", "Austin")

        p = F.addPresentation("Project 7", c)

        self.assert_(p.name == "Project 7")
        self.assert_(
            p.conference.name == "My Presentation Conference"
            and p.conference.date == "4/1/2010"
            and p.conference.location == "Austin"
        )

        db.put(p)

        key = p.key()

        p = db.get(key)

        self.assert_(p.name == "Project 7")
        self.assert_(
            p.conference.name == "My Presentation Conference"
            and p.conference.date == "4/1/2010"
            and p.conference.location == "Austin"
        )