From 715b6ec2f62296f8b6e23d14403d599893d2dae1 Mon Sep 17 00:00:00 2001 From: Jamie Alexandre Date: Thu, 9 Apr 2015 14:56:42 -0700 Subject: [PATCH] Update test for #2470 to properly catch error even on Travis. --- python-packages/securesync/tests/crypto_tests.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python-packages/securesync/tests/crypto_tests.py b/python-packages/securesync/tests/crypto_tests.py index c7c5123256..793728528e 100755 --- a/python-packages/securesync/tests/crypto_tests.py +++ b/python-packages/securesync/tests/crypto_tests.py @@ -257,13 +257,14 @@ def test_facility_group_save(self): class TestHashableFieldsAndSerialization(unittest.TestCase): def test_description_exclusion_regression_bug_2470(self): + """FacilityGroup.__init__ used to append "description" to _unhashable_fields, which affected other classes as well. + This test ensures that the description is not being excluded from Device._hashable_representation, even after + instantiating a FacilityGroup.""" d = Device(name="Test", description="Test") - - good_serialization = d._hashable_representation() - - g = FacilityGroup() - possibly_bad_serialization = d._hashable_representation() + self.assertIn("description=Test", possibly_bad_serialization, "Hashable representation of Device did not include description") - self.assertEqual(good_serialization, possibly_bad_serialization, "Instatiating a FacilityGroup changed hashable representation of Device") \ No newline at end of file + g = FacilityGroup() + possibly_worse_serialization = d._hashable_representation() + self.assertIn("description=Test", possibly_worse_serialization, "Instantiating a FacilityGroup changed hashable representation of Device") \ No newline at end of file