Example #1
0
	def test_chall6(self):
		self.userEntity.streak = 3
		complete = challengecheck(self.userEntity, self.lecture, self.checkin)
		self.assertEqual(complete, [])
		self.userEntity.streak = 4
		complete = challengecheck(self.userEntity, self.lecture, self.checkin)
		self.assertEqual(complete[0].challengeid, 6)
Example #2
0
	def test_chall3(self):
		self.userEntity.count = 8
		complete = challengecheck(self.userEntity, self.lecture, self.checkin)
		self.assertEqual(complete, [])
		self.userEntity.count = 9
		complete = challengecheck(self.userEntity, self.lecture, self.checkin)
		self.assertEqual(complete[0].challengeid, 3)
Example #3
0
	def test_chall10(self):
		self.userEntity.history = []

		lecture1 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=14, duration=1, week=getCurrentWeek(), attended=True)
		lecture2 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=15, duration=1, week=getCurrentWeek(), attended=True)
		lecture3 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=16, duration=1, week=getCurrentWeek(), attended=True)
		lecture4 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=17, duration=1, week=getCurrentWeek(), attended=True)

		checkin1 = CheckIn(student=self.userEntity, lecture=lecture1, date=datetime.date.today(), time=datetime.datetime.now().time())
		checkin2 = CheckIn(student=self.userEntity, lecture=lecture2, date=datetime.date.today(), time=datetime.datetime.now().time())
		checkin3 = CheckIn(student=self.userEntity, lecture=lecture3, date=datetime.date.today(), time=datetime.datetime.now().time())
		checkin4 = CheckIn(student=self.userEntity, lecture=lecture4, date=datetime.date.today(), time=datetime.datetime.now().time())

		self.userEntity.history.append(lecture1)
		complete = challengecheck(self.userEntity, lecture1, checkin1)
		self.assertEqual(complete, [])

		self.userEntity.history.append(lecture2)
		complete = challengecheck(self.userEntity, lecture2, checkin2)
		self.assertEqual(complete, [])

		self.userEntity.history.append(lecture3)
		complete = challengecheck(self.userEntity, lecture3, checkin3)
		self.assertEqual(complete, [])

		self.userEntity.history.append(lecture4)
		complete = challengecheck(self.userEntity, lecture4, checkin4)
		self.assertEqual(complete[0].challengeid, 10)
Example #4
0
	def test_chall9(self):
		lecture1 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=10, duration=1, week=getCurrentWeek(), attended=True)
		checkin1 = CheckIn(student=self.userEntity, lecture=lecture1, date=datetime.date.today(), time=datetime.datetime.now().time())
		complete = challengecheck(self.userEntity, lecture1, checkin1)
		self.assertEqual(complete, [])

		lecture2 = Lecture(module='GENG0013', title='TT Math Support', location='2', day=0, time=9, duration=1, week=getCurrentWeek(), attended=True)
		checkin2 = CheckIn(student=self.userEntity, lecture=lecture2, date=datetime.date.today(), time=datetime.datetime.now().time())
		complete = challengecheck(self.userEntity, lecture2, checkin2)
		self.assertEqual(complete[0].challengeid, 9)
Example #5
0
	def test_chall1(self):
		complete = challengecheck(self.userEntity, self.lecture, self.checkin)
		self.assertEqual(complete[0].challengeid, 1)