Exemple #1
0
 def test_return_true_when_remarks_is_only_value_in_received_and_has_changed(
         self):
     consignee = Consignee(name='Some Name',
                           location='Some Location',
                           remarks='some remark!')
     received_consignee = {'remarks': 'another remark!'}
     self.assertTrue(
         consignee.has_only_changed_editable_fields(received_consignee))
Exemple #2
0
 def test_return_appropriately_when_non_core_fields_exist_in_recieve(self):
     consignee = Consignee(name='Some Name',
                           location='Some Location',
                           remarks='some remark!')
     received_consignee = {
         'remarks': 'another remark!',
         'randome_value': 'Whoa!'
     }
     self.assertTrue(
         consignee.has_only_changed_editable_fields(received_consignee))
Exemple #3
0
 def test_return_false_if_name_has_changed_along_with_remarks(self):
     consignee = Consignee(name='Some Name',
                           location='Some Location',
                           remarks='some remark!')
     received_consignee = {
         'name': 'Another Name',
         'location': 'Some Location',
         'remarks': 'another remark!'
     }
     self.assertFalse(
         consignee.has_only_changed_editable_fields(received_consignee))
Exemple #4
0
 def test_return_appropriately_when_non_core_fields_exist_in_recieve(self):
     consignee = Consignee(name='Some Name', location='Some Location', remarks='some remark!')
     received_consignee = {'remarks': 'another remark!', 'randome_value': 'Whoa!'}
     self.assertTrue(consignee.has_only_changed_editable_fields(received_consignee))
Exemple #5
0
 def test_return_true_when_remarks_is_only_value_in_received_and_has_changed(self):
     consignee = Consignee(name='Some Name', location='Some Location', remarks='some remark!')
     received_consignee = {'remarks': 'another remark!'}
     self.assertTrue(consignee.has_only_changed_editable_fields(received_consignee))
Exemple #6
0
 def test_return_false_if_name_has_changed_along_with_remarks(self):
     consignee = Consignee(name='Some Name', location='Some Location', remarks='some remark!')
     received_consignee = {'name': 'Another Name', 'location': 'Some Location','remarks': 'another remark!'}
     self.assertFalse(consignee.has_only_changed_editable_fields(received_consignee))