Ejemplo n.º 1
0
 def test_gethints(self):
     """
     Checks that gethints returns the right data.
     """
     request = RequestFactory()
     post = request.post(self.url, {'field': 'mod_queue'})
     out = view.get_hints(post, self.course_id, 'mod_queue')
     print out
     self.assertTrue(out['other_field'] == 'hints')
     expected = {self.problem_id: [(u'2.0', {u'2': [u'Hint 2', 1]})]}
     self.assertTrue(out['all_hints'] == expected)
 def test_gethints(self):
     """
     Checks that gethints returns the right data.
     """
     request = RequestFactory()
     post = request.post(self.url, {"field": "mod_queue"})
     out = view.get_hints(post, self.course_id, "mod_queue")
     print out
     self.assertTrue(out["other_field"] == "hints")
     expected = {self.problem_id: [(u"2.0", {u"2": [u"Hint 2", 1]})]}
     self.assertTrue(out["all_hints"] == expected)
 def test_gethints_other(self):
     """
     Same as above, with hints instead of mod_queue
     """
     request = RequestFactory()
     post = request.post(self.url, {"field": "hints"})
     out = view.get_hints(post, self.course_id, "hints")
     print out
     self.assertTrue(out["other_field"] == "mod_queue")
     expected = {
         self.problem_id: [("1.0", {"1": ["Hint 1", 2], "3": ["Hint 3", 12]}), ("2.0", {"4": ["Hint 4", 3]})]
     }
     self.assertTrue(out["all_hints"] == expected)
Ejemplo n.º 4
0
 def test_gethints_other(self):
     """
     Same as above, with hints instead of mod_queue
     """
     request = RequestFactory()
     post = request.post(self.url, {'field': 'hints'})
     out = view.get_hints(post, self.course_id, 'hints')
     print out
     self.assertTrue(out['other_field'] == 'mod_queue')
     expected = {self.problem_id: [('1.0', {'1': ['Hint 1', 2],
                                            '3': ['Hint 3', 12]}),
                                   ('2.0', {'4': ['Hint 4', 3]})
                                   ]}
     self.assertTrue(out['all_hints'] == expected)