Skip to content

Instantly share code, notes, and snippets.

@brno32
Created June 9, 2021 15:23
Show Gist options
  • Save brno32/8570ad566e6fb957e7223ceab4d8bd32 to your computer and use it in GitHub Desktop.
Save brno32/8570ad566e6fb957e7223ceab4d8bd32 to your computer and use it in GitHub Desktop.
import os
from simple_mockforce import mock_salesforce
from simple_salesforce import Salesforce
@mock_salesforce
def test_api():
salesforce = Salesforce(
username=os.getenv["SFDC_USERNAME"],
password=os.getenv["SFDC_PASSWORD"],
security_token=os.getenv["SFDC_SECURITY_TOKEN"]
)
response = salesforce.Account.create({"Name": "Test Account"})
account_id = response["id"]
account = salesforce.Account.get(account_id)
assert account["Name"] == "Test Account"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment