Skip to content

Commit

Permalink
fixtures
Browse files Browse the repository at this point in the history
fixture fun

revert postgres

fixtures
  • Loading branch information
mwvolo committed Feb 28, 2024
1 parent c1d2167 commit 06300e7
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 105 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

services:
postgres:
image: postgres:14
image: postgres:13
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
Expand All @@ -36,7 +36,7 @@ jobs:
- run: pip install -r requirements/test.txt

- name: Check migrations
run: python manage.py makemigrations --dry-run --check
run: python manage.py makemigrations --check

- name: Run tests and generate coverage reports
run: coverage run --source '.' manage.py test --settings=openstax.settings.test
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.9
3.11
6 changes: 0 additions & 6 deletions fixtures/vcr_cassettes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
# VCR Recordings for openstax-cms
These are VCR cassettes to record interactions with Salesforce.
If you need to change a test that interacts with these, you can remove the affected yaml file and rerun the tests,
this will regenerate the API interaction.

**Be sure to remove any usernames or passwords from the file before checking them in.**
22 changes: 12 additions & 10 deletions fixtures/vcr_cassettes/books_license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ interactions:
response:
body:
string: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse></loginResponse></soapenv:Body></soapenv:Envelope>
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><metadataServerUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/m/57.0/00DOx000002qc01</metadataServerUrl><passwordExpired>false</passwordExpired><sandbox>true</sandbox><serverUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/u/57.0/00DOx000002qc01</serverUrl><sessionId>00DOx000002qc01!AQEAQF2cYbO.p0JWJlBNDnChZd7X5xizdDbtmoe.29hI9rztJW0J8hN8VuzWnVfb55rN0PWexxpTHIeHrW7U5sFx4.trlQ85</sessionId><userId>005U0000005akrEIAQ</userId><userInfo><accessibilityMode>false</accessibilityMode><chatterExternal>false</chatterExternal><currencySymbol>$</currencySymbol><orgAttachmentFileSizeLimit>5242880</orgAttachmentFileSizeLimit><orgDefaultCurrencyIsoCode>USD</orgDefaultCurrencyIsoCode><orgDefaultCurrencyLocale>en_US</orgDefaultCurrencyLocale><orgDisallowHtmlAttachments>false</orgDisallowHtmlAttachments><orgHasPersonAccounts>true</orgHasPersonAccounts><organizationId>00DOx000002qc01MAA</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>OpenStax</organizationName><profileId>00eU0000000qdoxIAA</profileId><roleId>00E6f000001ybA2EAI</roleId><sessionSecondsValid>86400</sessionSecondsValid><userDefaultCurrencyIsoCode
xsi:nil="true"/><userEmail>[email protected]</userEmail><userFullName>Michael
Volo</userFullName><userId>005U0000005akrEIAQ</userId><userLanguage>en_US</userLanguage><userLocale>en_US</userLocale><userName>[email protected]</userName><userTimeZone>America/Chicago</userTimeZone><userType>Standard</userType><userUiSkin>Theme3</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>
headers:
Cache-Control:
- no-cache,must-revalidate,max-age=0,no-store,private
Expand All @@ -41,10 +43,10 @@ interactions:
Content-Type:
- text/xml; charset=utf-8
Date:
- Tue, 27 Feb 2024 23:19:19 GMT
- Wed, 28 Feb 2024 00:30:00 GMT
Set-Cookie:
- BrowserId=odYhydXGEe6Bq9PTdWh10g; domain=.salesforce.com; path=/; expires=Wed,
26-Feb-2025 23:19:19 GMT; Max-Age=31536000
- BrowserId=gc8VMdXQEe6miukBr8Go3g; domain=.salesforce.com; path=/; expires=Thu,
27-Feb-2025 00:30:00 GMT; Max-Age=31536000
Vary:
- Accept-Encoding
status:
Expand All @@ -64,7 +66,7 @@ interactions:
Content-Type:
- application/json
Cookie:
- BrowserId=odYhydXGEe6Bq9PTdWh10g
- BrowserId=gc8VMdXQEe6miukBr8Go3g
User-Agent:
- python-requests/2.31.0
X-PrettyPrint:
Expand All @@ -87,16 +89,16 @@ interactions:
Content-Type:
- application/json;charset=UTF-8
Date:
- Tue, 27 Feb 2024 23:19:19 GMT
- Wed, 28 Feb 2024 00:30:01 GMT
Server:
- sfdcedge
Set-Cookie:
- CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:19 GMT; Max-Age=31536000;
- CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:30:01 GMT; Max-Age=31536000;
secure
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:19
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:30:01
GMT; Max-Age=31536000; secure
Sforce-Limit-Info:
- api-usage=63310/5000000
- api-usage=64987/5000000
Strict-Transport-Security:
- max-age=63072000; includeSubDomains
Transfer-Encoding:
Expand All @@ -110,7 +112,7 @@ interactions:
X-SFDC-Edge-Cache:
- MISS
X-SFDC-Request-Id:
- 3233ff3372b10b91c7661daca024ca60
- 2f53fd0746bc84b7370c052e05f9780c
status:
code: 200
message: OK
Expand Down
22 changes: 12 additions & 10 deletions fixtures/vcr_cassettes/books_no_cnx_id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ interactions:
response:
body:
string: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse></loginResponse></soapenv:Body></soapenv:Envelope>
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><metadataServerUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/m/57.0/00DOx000002qc01</metadataServerUrl><passwordExpired>false</passwordExpired><sandbox>true</sandbox><serverUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/u/57.0/00DOx000002qc01</serverUrl><sessionId>00DOx000002qc01!AQEAQF2cYbO.p0JWJlBNDnChZd7X5xizdDbtmoe.29hI9rztJW0J8hN8VuzWnVfb55rN0PWexxpTHIeHrW7U5sFx4.trlQ85</sessionId><userId>005U0000005akrEIAQ</userId><userInfo><accessibilityMode>false</accessibilityMode><chatterExternal>false</chatterExternal><currencySymbol>$</currencySymbol><orgAttachmentFileSizeLimit>5242880</orgAttachmentFileSizeLimit><orgDefaultCurrencyIsoCode>USD</orgDefaultCurrencyIsoCode><orgDefaultCurrencyLocale>en_US</orgDefaultCurrencyLocale><orgDisallowHtmlAttachments>false</orgDisallowHtmlAttachments><orgHasPersonAccounts>true</orgHasPersonAccounts><organizationId>00DOx000002qc01MAA</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>OpenStax</organizationName><profileId>00eU0000000qdoxIAA</profileId><roleId>00E6f000001ybA2EAI</roleId><sessionSecondsValid>86400</sessionSecondsValid><userDefaultCurrencyIsoCode
xsi:nil="true"/><userEmail>[email protected]</userEmail><userFullName>Michael
Volo</userFullName><userId>005U0000005akrEIAQ</userId><userLanguage>en_US</userLanguage><userLocale>en_US</userLocale><userName>[email protected]</userName><userTimeZone>America/Chicago</userTimeZone><userType>Standard</userType><userUiSkin>Theme3</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>
headers:
Cache-Control:
- no-cache,must-revalidate,max-age=0,no-store,private
Expand All @@ -41,10 +43,10 @@ interactions:
Content-Type:
- text/xml; charset=utf-8
Date:
- Tue, 27 Feb 2024 23:19:20 GMT
- Wed, 28 Feb 2024 00:30:02 GMT
Set-Cookie:
- BrowserId=opdPKNXGEe6eta19-CJo0A; domain=.salesforce.com; path=/; expires=Wed,
26-Feb-2025 23:19:20 GMT; Max-Age=31536000
- BrowserId=gt7XKdXQEe6hH4HPu_Ckvg; domain=.salesforce.com; path=/; expires=Thu,
27-Feb-2025 00:30:02 GMT; Max-Age=31536000
Vary:
- Accept-Encoding
status:
Expand All @@ -64,7 +66,7 @@ interactions:
Content-Type:
- application/json
Cookie:
- BrowserId=opdPKNXGEe6eta19-CJo0A
- BrowserId=gt7XKdXQEe6hH4HPu_Ckvg
User-Agent:
- python-requests/2.31.0
X-PrettyPrint:
Expand All @@ -87,16 +89,16 @@ interactions:
Content-Type:
- application/json;charset=UTF-8
Date:
- Tue, 27 Feb 2024 23:19:21 GMT
- Wed, 28 Feb 2024 00:30:02 GMT
Server:
- sfdcedge
Set-Cookie:
- CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:21 GMT; Max-Age=31536000;
- CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:30:02 GMT; Max-Age=31536000;
secure
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:21
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:30:02
GMT; Max-Age=31536000; secure
Sforce-Limit-Info:
- api-usage=63309/5000000
- api-usage=64989/5000000
Strict-Transport-Security:
- max-age=63072000; includeSubDomains
Transfer-Encoding:
Expand All @@ -110,7 +112,7 @@ interactions:
X-SFDC-Edge-Cache:
- MISS
X-SFDC-Request-Id:
- bb57bdbf4d3796310f25029ae170f943
- 5977a273f6ff1e4172411847ae359401
status:
code: 200
message: OK
Expand Down
22 changes: 12 additions & 10 deletions fixtures/vcr_cassettes/books_prealgebra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ interactions:
response:
body:
string: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse></loginResponse></soapenv:Body></soapenv:Envelope>
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><metadataServerUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/m/57.0/00DOx000002qc01</metadataServerUrl><passwordExpired>false</passwordExpired><sandbox>true</sandbox><serverUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/u/57.0/00DOx000002qc01</serverUrl><sessionId>00DOx000002qc01!AQEAQF2cYbO.p0JWJlBNDnChZd7X5xizdDbtmoe.29hI9rztJW0J8hN8VuzWnVfb55rN0PWexxpTHIeHrW7U5sFx4.trlQ85</sessionId><userId>005U0000005akrEIAQ</userId><userInfo><accessibilityMode>false</accessibilityMode><chatterExternal>false</chatterExternal><currencySymbol>$</currencySymbol><orgAttachmentFileSizeLimit>5242880</orgAttachmentFileSizeLimit><orgDefaultCurrencyIsoCode>USD</orgDefaultCurrencyIsoCode><orgDefaultCurrencyLocale>en_US</orgDefaultCurrencyLocale><orgDisallowHtmlAttachments>false</orgDisallowHtmlAttachments><orgHasPersonAccounts>true</orgHasPersonAccounts><organizationId>00DOx000002qc01MAA</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>OpenStax</organizationName><profileId>00eU0000000qdoxIAA</profileId><roleId>00E6f000001ybA2EAI</roleId><sessionSecondsValid>86400</sessionSecondsValid><userDefaultCurrencyIsoCode
xsi:nil="true"/><userEmail>[email protected]</userEmail><userFullName>Michael
Volo</userFullName><userId>005U0000005akrEIAQ</userId><userLanguage>en_US</userLanguage><userLocale>en_US</userLocale><userName>[email protected]</userName><userTimeZone>America/Chicago</userTimeZone><userType>Standard</userType><userUiSkin>Theme3</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>
headers:
Cache-Control:
- no-cache,must-revalidate,max-age=0,no-store,private
Expand All @@ -41,10 +43,10 @@ interactions:
Content-Type:
- text/xml; charset=utf-8
Date:
- Tue, 27 Feb 2024 23:19:14 GMT
- Wed, 28 Feb 2024 00:29:56 GMT
Set-Cookie:
- BrowserId=n0R6ntXGEe6-5qsrZ5B8kw; domain=.salesforce.com; path=/; expires=Wed,
26-Feb-2025 23:19:14 GMT; Max-Age=31536000
- BrowserId=f5PKutXQEe6_ee9wBfRpCA; domain=.salesforce.com; path=/; expires=Thu,
27-Feb-2025 00:29:56 GMT; Max-Age=31536000
Vary:
- Accept-Encoding
status:
Expand All @@ -64,7 +66,7 @@ interactions:
Content-Type:
- application/json
Cookie:
- BrowserId=n0R6ntXGEe6-5qsrZ5B8kw
- BrowserId=f5PKutXQEe6_ee9wBfRpCA
User-Agent:
- python-requests/2.31.0
X-PrettyPrint:
Expand All @@ -87,16 +89,16 @@ interactions:
Content-Type:
- application/json;charset=UTF-8
Date:
- Tue, 27 Feb 2024 23:19:15 GMT
- Wed, 28 Feb 2024 00:29:57 GMT
Server:
- sfdcedge
Set-Cookie:
- CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:15 GMT; Max-Age=31536000;
- CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:29:57 GMT; Max-Age=31536000;
secure
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:15
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:29:57
GMT; Max-Age=31536000; secure
Sforce-Limit-Info:
- api-usage=63309/5000000
- api-usage=64987/5000000
Strict-Transport-Security:
- max-age=63072000; includeSubDomains
Transfer-Encoding:
Expand All @@ -110,7 +112,7 @@ interactions:
X-SFDC-Edge-Cache:
- MISS
X-SFDC-Request-Id:
- e2392564414ccc5e7041aa9c5fce61ea
- fbc5230d52faa4002c8f30e344b4ae22
status:
code: 200
message: OK
Expand Down
22 changes: 12 additions & 10 deletions fixtures/vcr_cassettes/books_univ_physics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ interactions:
response:
body:
string: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse></loginResponse></soapenv:Body></soapenv:Envelope>
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><metadataServerUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/m/57.0/00DOx000002qc01</metadataServerUrl><passwordExpired>false</passwordExpired><sandbox>true</sandbox><serverUrl>https://openstax--staging.sandbox.my.salesforce.com/services/Soap/u/57.0/00DOx000002qc01</serverUrl><sessionId>00DOx000002qc01!AQEAQF2cYbO.p0JWJlBNDnChZd7X5xizdDbtmoe.29hI9rztJW0J8hN8VuzWnVfb55rN0PWexxpTHIeHrW7U5sFx4.trlQ85</sessionId><userId>005U0000005akrEIAQ</userId><userInfo><accessibilityMode>false</accessibilityMode><chatterExternal>false</chatterExternal><currencySymbol>$</currencySymbol><orgAttachmentFileSizeLimit>5242880</orgAttachmentFileSizeLimit><orgDefaultCurrencyIsoCode>USD</orgDefaultCurrencyIsoCode><orgDefaultCurrencyLocale>en_US</orgDefaultCurrencyLocale><orgDisallowHtmlAttachments>false</orgDisallowHtmlAttachments><orgHasPersonAccounts>true</orgHasPersonAccounts><organizationId>00DOx000002qc01MAA</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>OpenStax</organizationName><profileId>00eU0000000qdoxIAA</profileId><roleId>00E6f000001ybA2EAI</roleId><sessionSecondsValid>86400</sessionSecondsValid><userDefaultCurrencyIsoCode
xsi:nil="true"/><userEmail>[email protected]</userEmail><userFullName>Michael
Volo</userFullName><userId>005U0000005akrEIAQ</userId><userLanguage>en_US</userLanguage><userLocale>en_US</userLocale><userName>[email protected]</userName><userTimeZone>America/Chicago</userTimeZone><userType>Standard</userType><userUiSkin>Theme3</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>
headers:
Cache-Control:
- no-cache,must-revalidate,max-age=0,no-store,private
Expand All @@ -41,10 +43,10 @@ interactions:
Content-Type:
- text/xml; charset=utf-8
Date:
- Tue, 27 Feb 2024 23:19:17 GMT
- Wed, 28 Feb 2024 00:29:58 GMT
Set-Cookie:
- BrowserId=oO2WhNXGEe6HVm2wsnsfdw; domain=.salesforce.com; path=/; expires=Wed,
26-Feb-2025 23:19:17 GMT; Max-Age=31536000
- BrowserId=gPhkGdXQEe6Bm2F5LRKfGw; domain=.salesforce.com; path=/; expires=Thu,
27-Feb-2025 00:29:58 GMT; Max-Age=31536000
Vary:
- Accept-Encoding
status:
Expand All @@ -64,7 +66,7 @@ interactions:
Content-Type:
- application/json
Cookie:
- BrowserId=oO2WhNXGEe6HVm2wsnsfdw
- BrowserId=gPhkGdXQEe6Bm2F5LRKfGw
User-Agent:
- python-requests/2.31.0
X-PrettyPrint:
Expand All @@ -87,16 +89,16 @@ interactions:
Content-Type:
- application/json;charset=UTF-8
Date:
- Tue, 27 Feb 2024 23:19:18 GMT
- Wed, 28 Feb 2024 00:29:59 GMT
Server:
- sfdcedge
Set-Cookie:
- CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:18 GMT; Max-Age=31536000;
- CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:29:59 GMT; Max-Age=31536000;
secure
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Wed, 26-Feb-2025 23:19:18
- LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 27-Feb-2025 00:29:59
GMT; Max-Age=31536000; secure
Sforce-Limit-Info:
- api-usage=63308/5000000
- api-usage=64987/5000000
Strict-Transport-Security:
- max-age=63072000; includeSubDomains
Transfer-Encoding:
Expand All @@ -110,7 +112,7 @@ interactions:
X-SFDC-Edge-Cache:
- MISS
X-SFDC-Request-Id:
- 7250fdb7c0fc012aeb736785f98fe5f9
- 54b61e4f06b6a34e374038de512427af
status:
code: 200
message: OK
Expand Down
Loading

0 comments on commit 06300e7

Please sign in to comment.