def test_custom_object_general(self): """ Create, read and delete any general custom object. Object name and field name are user configurable by TEST_CUSTOM_FIELD. """ obj = GeneralCustomModel(GeneralCustomField='sf_test') obj.save() try: results = GeneralCustomModel.objects.all()[0:1] self.assertEqual(len(results), 1) self.assertEqual(results[0].GeneralCustomField, 'sf_test') finally: obj.delete()
def test_custom_object_general(self): """ Create, read and delete any general custom object. Object name and field name are user configurable by TEST_CUSTOM_FIELD. """ table_list_cache = connections['salesforce'].introspection.table_list_cache table_names = [x['name'] for x in table_list_cache['sobjects']] if not test_custom_db_table in sf_tables: self.skipTest("Not found the expected custom object '%s'" % test_custom_db_table) obj = GeneralCustomModel(GeneralCustomField='sf_test') obj.save() try: results = GeneralCustomModel.objects.all()[0:1] self.assertEqual(len(results), 1) self.assertEqual(results[0].GeneralCustomField, 'sf_test') finally: obj.delete()
def test_custom_object_general(self): """ Create, read and delete any general custom object. Object name and field name are user configurable by TEST_CUSTOM_FIELD. """ table_list_cache = connections[ 'salesforce'].introspection.table_list_cache table_names = [x['name'] for x in table_list_cache['sobjects']] if not test_custom_db_table in sf_tables: self.skipTest("Not found the expected custom object '%s'" % test_custom_db_table) obj = GeneralCustomModel(GeneralCustomField='sf_test') obj.save() try: results = GeneralCustomModel.objects.all()[0:1] self.assertEqual(len(results), 1) self.assertEqual(results[0].GeneralCustomField, 'sf_test') finally: obj.delete()