Beispiel #1
0
 def test_create_from_dict(self):
     q = Quiz(description="first")
     d = q.as_dict()
     q2 = Quiz.create_from_dict(d)
     self.assertEquals(q2.description, "first")
     self.assertEquals(q.allow_redo, q2.allow_redo)
     self.assertEquals(q.rhetorical, q2.rhetorical)
     self.assertEquals(q.show_submit_state, q2.show_submit_state)
Beispiel #2
0
 def test_create_from_dict_defaults(self):
     d = {
         'description': 'Test Quiz',
     }
     q = Quiz.create_from_dict(d)
     self.assertEquals(q.description, 'Test Quiz')
     self.assertEquals(q.allow_redo, True)
     self.assertEquals(q.rhetorical, False)
     self.assertEquals(q.show_submit_state, True)