Dec-21-2017, 04:57 PM
Quote:So when you do for item in responses:
item will be empty and you check if item is in in self.my_survey Confused
How do you get this to work i don't know.
sorry about that...
class Testing(unittest.TestCase): def testThis(self): responses = [1,2,3]#or ['a','b','c'] is fineSo are the assert methods totally recursive? What am I missing here?
b/c
#1
for item in responses: self.assertIn(item,self.my_survey.responses)I would this this code would be the **only** right one.
#2
for item in responses: self.assertIn(item, self.my_survey.show_resp)and this snippet also works:
#3
for item in responses: self.assertIn(item, self.my_survey.foo)IDU python's internal 'mechanism'/'logic' in this example. I'd think snippet 2 only should work...but they all produce the same output.