def _parseField(self, value, filename=None): if value is None: value = '' elif self._vocabulary is not None: value = title_or_value(self._vocabulary, value) return AsTextDiff._parseField(self, value, filename)
def _test_diff_choice(self, value1, value2, same): self.obj1.choice = value1 self.obj2.choice = value2 diff = ChoiceDiff(self.obj1, self.obj2, 'choice') self.assertTrue(IDifference.providedBy(diff)) self.assertEqual(diff.same, same) inline_diff = diff.inline_diff() if same: self.assertFalse(inline_diff) else: if value1 is not None: self.assertTrue( title_or_value(VOCABULARY, value1) in inline_diff) if value2 is not None: self.assertTrue( title_or_value(VOCABULARY, value2) in inline_diff)