Repository: DjangoGirls/djangogirls

Issue:
Calling flickr API when loading modules
Today my connection was a bit unstable when I was setting up the repo in a different device and `./manage.py createsuperuser` failed.

I was trying to understand why and then I realized we're calling `select_random_flickr_photos(4)` in the module scope (`core/default_eventpage_content`). That module is imported in one of the models files (`core/models/event` I think) and it gets called whenever Django is initialized.

I think we need to make that lazy so it doesn't get called when its not gonna be used.


Discussion:

Resolving patch:
diff --git a/core/default_eventpage_content.py b/core/default_eventpage_content.py
--- a/core/default_eventpage_content.py
+++ b/core/default_eventpage_content.py
@@ -1,6 +1,8 @@
 # -*- encoding: utf-8 -*-
 import random
 
+from functools import lru_cache
+
 from django.conf import settings
 from django.core.files.uploadedfile import UploadedFile
 from django.utils.translation import gettext_lazy as _
@@ -25,9 +27,6 @@
 }
 
 
-four_random_flickr_photos = select_random_flickr_photos(4)
-
-
 def get_random_photo(section):
     if section in DEFAULT_BACKGROUND_PHOTOS:
         photos = DEFAULT_BACKGROUND_PHOTOS[section]
@@ -37,11 +36,16 @@ def get_random_photo(section):
     return None
 
 
+@lru_cache
+def get_four_random_flickr_photos():
+    return select_random_flickr_photos(4)
+
+
 def select_photo(section):
+    four_random_flickr_photos = get_four_random_flickr_photos()
     if not four_random_flickr_photos:
         return get_random_photo(section)
-    else:
-        return four_random_flickr_photos.pop(0)
+    return four_random_flickr_photos.pop(0)
 
 
 def get_default_eventpage_data():


Test patch:
diff --git a/tests/core/vcr/new_event_short.yaml b/tests/core/vcr/new_event_short.yaml
--- a/tests/core/vcr/new_event_short.yaml
+++ b/tests/core/vcr/new_event_short.yaml
@@ -2,30 +2,52 @@ interactions:
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      User-Agent:
+      - python-requests/2.26.0
     method: GET
     uri: https://nominatim.openstreetmap.org/search?format=json&q=Oz%2C+Neverland
   response:
-    body: {string: '[]'}
+    body:
+      string: '[]'
     headers:
-      Access-Control-Allow-Methods: ['OPTIONS,GET']
-      Access-Control-Allow-Origin: ['*']
-      Connection: [close]
-      Content-Type: [application/json; charset=UTF-8]
-      Date: ['Sat, 07 Jan 2017 16:24:31 GMT']
-      Server: [Apache/2.4.18 (Ubuntu)]
-    status: {code: 200, message: OK}
+      Access-Control-Allow-Methods:
+      - OPTIONS,GET
+      Access-Control-Allow-Origin:
+      - '*'
+      Connection:
+      - keep-alive
+      Content-Type:
+      - application/json; charset=UTF-8
+      Date:
+      - Wed, 04 Jan 2023 17:13:49 GMT
+      Keep-Alive:
+      - timeout=20
+      Server:
+      - nginx
+      Transfer-Encoding:
+      - chunked
+    status:
+      code: 200
+      message: OK
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['0']
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '0'
+      User-Agent:
+      - python-requests/2.26.0
     method: POST
     uri: https://slack.com/api/users.admin.invite?email=jan%40kowalski.example.org&first_name=Jan&set_active=True
   response:
@@ -33,58 +55,67 @@ interactions:
       string: !!binary |
         H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
     headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:31 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 fa9c1b753397f77263517fcc9fcbad17.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: [client]
-      X-Amz-Cf-Id: [gzs2bpnmMUMbz-bK9MXtnleFNqSKzd4FMgrMG4ql2Tx7kZ14gKR_Nw==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [deb94121-c101-424f-b762-b383a703c9dd]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
-- request:
-    body: channel=%23general&text=%3Adjango_pony%3A+%3Azap%3A+Woohoo%21+%3Atada%3A+New+Django+Girls+alert%21+Welcome+Django+Girls+Oz%2C+Neverland.+Congrats+Jan++Kowalski%21&username=Django+Girls&icon_emoji=%3Adjango_heart%3A
-    headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['214']
-      Content-Type: [application/x-www-form-urlencoded]
-      User-Agent: [python-requests/2.12.4]
-    method: POST
-    uri: https://slack.com/api/chat.postMessage
-  response:
-    body:
-      string: !!binary |
-        H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
-    headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:31 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 4bb318ea28b336329e91675457ce5c60.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: ['chat:write:user']
-      X-Amz-Cf-Id: [Ytz_BCvk7FNV3TPqIaLW2__9K_sLukfSWgeqVIOHULwyM4GsO7bESA==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [2a035699-c1a6-41ed-b7d6-7b189134158c]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
+      access-control-allow-headers:
+      - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
+        x-b3-sampled, x-b3-flags
+      access-control-allow-origin:
+      - '*'
+      access-control-expose-headers:
+      - x-slack-req-id, retry-after
+      cache-control:
+      - private, no-cache, no-store, must-revalidate
+      content-encoding:
+      - gzip
+      content-length:
+      - '53'
+      content-type:
+      - application/json; charset=utf-8
+      date:
+      - Wed, 04 Jan 2023 17:13:50 GMT
+      expires:
+      - Mon, 26 Jul 1997 05:00:00 GMT
+      pragma:
+      - no-cache
+      referrer-policy:
+      - no-referrer
+      server:
+      - Apache
+      strict-transport-security:
+      - max-age=31536000; includeSubDomains; preload
+      vary:
+      - Accept-Encoding
+      via:
+      - envoy-www-iad-f9tl, envoy-edge-gru-b6r1
+      x-accepted-oauth-scopes:
+      - client
+      x-backend:
+      - main_normal main_bedrock_normal_with_overflow main_canary_with_overflow main_bedrock_canary_with_overflow
+        main_control_with_overflow main_bedrock_control_with_overflow
+      x-content-type-options:
+      - nosniff
+      x-edge-backend:
+      - envoy-www
+      x-envoy-upstream-service-time:
+      - '124'
+      x-powered-by:
+      - HHVM/4.153.1
+      x-robots-tag:
+      - noindex,nofollow
+      x-server:
+      - slack-www-hhvm-main-iad-bwuz
+      x-slack-backend:
+      - r
+      x-slack-edge-shared-secret-outcome:
+      - no-match
+      x-slack-req-id:
+      - 625692836a18ea22704351a6ec29eb1e
+      x-slack-shared-secret-outcome:
+      - no-match
+      x-slack-unique-id:
+      - Y7Wzzhwy5LEWhHIz-tT29AAAEBI
+      x-xss-protection:
+      - '0'
+    status:
+      code: 200
+      message: OK
 version: 1
diff --git a/tests/core/vcr/new_event_with_one_organizer.yaml b/tests/core/vcr/new_event_with_one_organizer.yaml
--- a/tests/core/vcr/new_event_with_one_organizer.yaml
+++ b/tests/core/vcr/new_event_with_one_organizer.yaml
@@ -2,89 +2,168 @@ interactions:
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      User-Agent:
+      - python-requests/2.26.0
     method: GET
     uri: https://nominatim.openstreetmap.org/search?format=json&q=Oz%2C+Neverland
   response:
-    body: {string: '[]'}
+    body:
+      string: '[]'
     headers:
-      Access-Control-Allow-Methods: ['OPTIONS,GET']
-      Access-Control-Allow-Origin: ['*']
-      Connection: [close]
-      Content-Type: [application/json; charset=UTF-8]
-      Date: ['Sat, 07 Jan 2017 16:24:31 GMT']
-      Server: [Apache/2.4.18 (Ubuntu)]
-    status: {code: 200, message: OK}
+      Access-Control-Allow-Methods:
+      - OPTIONS,GET
+      Access-Control-Allow-Origin:
+      - '*'
+      Connection:
+      - keep-alive
+      Content-Type:
+      - application/json; charset=UTF-8
+      Date:
+      - Wed, 04 Jan 2023 17:13:46 GMT
+      Keep-Alive:
+      - timeout=20
+      Server:
+      - nginx
+      Transfer-Encoding:
+      - chunked
+    status:
+      code: 200
+      message: OK
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['0']
-      User-Agent: [python-requests/2.12.4]
-    method: POST
-    uri: https://slack.com/api/users.admin.invite?email=jan%40kowalski.example.org&first_name=Jan&set_active=True
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      User-Agent:
+      - python-requests/2.26.0
+    method: GET
+    uri: https://www.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=None&user_id=None&extras=o_dims&format=json&nojsoncallback=1
   response:
     body:
-      string: !!binary |
-        H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
+      string: '{"stat":"fail","code":100,"message":"Invalid API Key (Key has invalid
+        format)"}'
     headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:32 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 c661b957fae167a13aab464a9ce9b407.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: [client]
-      X-Amz-Cf-Id: [frMhqMiFYI39NKGmpQdN0wYRBH_vZDLNHx9kIDj-oZhQWN4nLygfKA==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [08e944c7-4d00-4bad-abaa-12069f524a45]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '79'
+      Content-Type:
+      - application/json
+      Date:
+      - Wed, 04 Jan 2023 17:13:47 GMT
+      Via:
+      - 1.1 a9099ea1e29fa928ad562a5af3831b88.cloudfront.net (CloudFront)
+      X-Amz-Cf-Id:
+      - i6eYZ6ckGdI-rRC46AEREvH2FpYyrfWO2Hvx6XpMlyhj_XT3omDmVQ==
+      X-Amz-Cf-Pop:
+      - GRU3-C2
+      X-Cache:
+      - Miss from cloudfront
+      server:
+      - Apache/2.4.54 (Ubuntu)
+      set-cookie:
+      - ccc=%7B%22needsConsent%22%3Atrue%2C%22managed%22%3A0%2C%22changed%22%3A0%2C%22info%22%3A%7B%22cookieBlock%22%3A%7B%22level%22%3A0%2C%22blockRan%22%3A0%7D%7D%7D;
+        expires=Fri, 03-Feb-2023 17:13:46 GMT; Max-Age=2592000; path=/; domain=.flickr.com
+      - ccc=%7B%22needsConsent%22%3Atrue%2C%22managed%22%3A0%2C%22changed%22%3A0%2C%22info%22%3A%7B%22cookieBlock%22%3A%7B%22level%22%3A0%2C%22blockRan%22%3A1%7D%7D%7D;
+        expires=Fri, 03-Feb-2023 17:13:46 GMT; Max-Age=2592000; path=/; domain=.flickr.com
+      x-content-type-options:
+      - nosniff
+      x-frame-options:
+      - SAMEORIGIN
+    status:
+      code: 200
+      message: OK
 - request:
-    body: channel=%23general&text=%3Adjango_pony%3A+%3Azap%3A+Woohoo%21+%3Atada%3A+New+Django+Girls+alert%21+Welcome+Django+Girls+Oz%2C+Neverland.+Congrats+Jan++Kowalski%21&username=Django+Girls&icon_emoji=%3Adjango_heart%3A
+    body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['214']
-      Content-Type: [application/x-www-form-urlencoded]
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '0'
+      User-Agent:
+      - python-requests/2.26.0
     method: POST
-    uri: https://slack.com/api/chat.postMessage
+    uri: https://slack.com/api/users.admin.invite?email=jan%40kowalski.example.org&first_name=Jan&set_active=True
   response:
     body:
       string: !!binary |
         H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
     headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:32 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 2789f57a191cda188474bba6a2541f3a.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: ['chat:write:user']
-      X-Amz-Cf-Id: [xkSnjaV3cuCGaUfcrONqmSYqXkT-i6CJyLqkUKhNmWqD0hFeUJTIgg==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [2d6ab793-f583-46ef-976f-c4023bfad79b]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
+      access-control-allow-headers:
+      - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
+        x-b3-sampled, x-b3-flags
+      access-control-allow-origin:
+      - '*'
+      access-control-expose-headers:
+      - x-slack-req-id, retry-after
+      cache-control:
+      - private, no-cache, no-store, must-revalidate
+      content-encoding:
+      - gzip
+      content-length:
+      - '53'
+      content-type:
+      - application/json; charset=utf-8
+      date:
+      - Wed, 04 Jan 2023 17:13:47 GMT
+      expires:
+      - Mon, 26 Jul 1997 05:00:00 GMT
+      pragma:
+      - no-cache
+      referrer-policy:
+      - no-referrer
+      server:
+      - Apache
+      strict-transport-security:
+      - max-age=31536000; includeSubDomains; preload
+      vary:
+      - Accept-Encoding
+      via:
+      - envoy-www-iad-hu06, envoy-edge-gru-doe0
+      x-accepted-oauth-scopes:
+      - client
+      x-backend:
+      - main_normal main_bedrock_normal_with_overflow main_canary_with_overflow main_bedrock_canary_with_overflow
+        main_control_with_overflow main_bedrock_control_with_overflow
+      x-content-type-options:
+      - nosniff
+      x-edge-backend:
+      - envoy-www
+      x-envoy-upstream-service-time:
+      - '121'
+      x-powered-by:
+      - HHVM/4.153.1
+      x-robots-tag:
+      - noindex,nofollow
+      x-server:
+      - slack-www-hhvm-main-iad-epvp
+      x-slack-backend:
+      - r
+      x-slack-edge-shared-secret-outcome:
+      - no-match
+      x-slack-req-id:
+      - 9e159a893f45bf36772f98e8debc9a63
+      x-slack-shared-secret-outcome:
+      - no-match
+      x-slack-unique-id:
+      - Y7WzywbFyvQkUoZf38C0dAAAEB8
+      x-xss-protection:
+      - '0'
+    status:
+      code: 200
+      message: OK
 version: 1
diff --git a/tests/core/vcr/new_event_with_two_organizers.yaml b/tests/core/vcr/new_event_with_two_organizers.yaml
--- a/tests/core/vcr/new_event_with_two_organizers.yaml
+++ b/tests/core/vcr/new_event_with_two_organizers.yaml
@@ -2,30 +2,52 @@ interactions:
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      User-Agent:
+      - python-requests/2.26.0
     method: GET
     uri: https://nominatim.openstreetmap.org/search?format=json&q=Oz%2C+Neverland
   response:
-    body: {string: '[]'}
+    body:
+      string: '[]'
     headers:
-      Access-Control-Allow-Methods: ['OPTIONS,GET']
-      Access-Control-Allow-Origin: ['*']
-      Connection: [close]
-      Content-Type: [application/json; charset=UTF-8]
-      Date: ['Sat, 07 Jan 2017 16:24:32 GMT']
-      Server: [Apache/2.4.18 (Ubuntu)]
-    status: {code: 200, message: OK}
+      Access-Control-Allow-Methods:
+      - OPTIONS,GET
+      Access-Control-Allow-Origin:
+      - '*'
+      Connection:
+      - keep-alive
+      Content-Type:
+      - application/json; charset=UTF-8
+      Date:
+      - Wed, 04 Jan 2023 17:13:48 GMT
+      Keep-Alive:
+      - timeout=20
+      Server:
+      - nginx
+      Transfer-Encoding:
+      - chunked
+    status:
+      code: 200
+      message: OK
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['0']
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '0'
+      User-Agent:
+      - python-requests/2.26.0
     method: POST
     uri: https://slack.com/api/users.admin.invite?email=jan%40kowalski.example.org&first_name=Jan&set_active=True
   response:
@@ -33,33 +55,82 @@ interactions:
       string: !!binary |
         H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
     headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:32 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 622b39b22357e70fa8da7e1f171019f3.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: [client]
-      X-Amz-Cf-Id: [38_ddzb4cx5NAKNNLWKscxHZManhAO9zSN9mZbdTglp9K5VyByL3Lg==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [d4027ea0-d962-4c25-9345-dc032fe5f019]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
+      access-control-allow-headers:
+      - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
+        x-b3-sampled, x-b3-flags
+      access-control-allow-origin:
+      - '*'
+      access-control-expose-headers:
+      - x-slack-req-id, retry-after
+      cache-control:
+      - private, no-cache, no-store, must-revalidate
+      content-encoding:
+      - gzip
+      content-length:
+      - '53'
+      content-type:
+      - application/json; charset=utf-8
+      date:
+      - Wed, 04 Jan 2023 17:13:48 GMT
+      expires:
+      - Mon, 26 Jul 1997 05:00:00 GMT
+      pragma:
+      - no-cache
+      referrer-policy:
+      - no-referrer
+      server:
+      - Apache
+      strict-transport-security:
+      - max-age=31536000; includeSubDomains; preload
+      vary:
+      - Accept-Encoding
+      via:
+      - envoy-www-iad-4juy, envoy-edge-gru-c8dy
+      x-accepted-oauth-scopes:
+      - client
+      x-backend:
+      - main_normal main_bedrock_normal_with_overflow main_canary_with_overflow main_bedrock_canary_with_overflow
+        main_control_with_overflow main_bedrock_control_with_overflow
+      x-content-type-options:
+      - nosniff
+      x-edge-backend:
+      - envoy-www
+      x-envoy-upstream-service-time:
+      - '123'
+      x-powered-by:
+      - HHVM/4.153.1
+      x-robots-tag:
+      - noindex,nofollow
+      x-server:
+      - slack-www-hhvm-main-iad-ohdj
+      x-slack-backend:
+      - r
+      x-slack-edge-shared-secret-outcome:
+      - no-match
+      x-slack-req-id:
+      - 5653a685d62833a00053ea47931bf6d6
+      x-slack-shared-secret-outcome:
+      - no-match
+      x-slack-unique-id:
+      - Y7WzzED7AUlb8qK_WjQLRwAAED4
+      x-xss-protection:
+      - '0'
+    status:
+      code: 200
+      message: OK
 - request:
     body: null
     headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['0']
-      User-Agent: [python-requests/2.12.4]
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '0'
+      User-Agent:
+      - python-requests/2.26.0
     method: POST
     uri: https://slack.com/api/users.admin.invite?email=ealenor%40organizer.example.org&first_name=Eleanor&set_active=True
   response:
@@ -67,58 +138,67 @@ interactions:
       string: !!binary |
         H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
     headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:32 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 6fe4f291bdbb60b59b125730d90a7eff.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: [client]
-      X-Amz-Cf-Id: [nc7x1uWTncUt6DlS78gF9-PGmCRU5LFjd11YpbFar84fHzxhAUAFDQ==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [119c9fb9-c927-4b6c-bf2d-aa6b8119b24f]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
-- request:
-    body: channel=%23general&text=%3Adjango_pony%3A+%3Azap%3A+Woohoo%21+%3Atada%3A+New+Django+Girls+alert%21+Welcome+Django+Girls+Oz%2C+Neverland.+Congrats+Jan++Kowalski%2C+Eleanor++Organizer%21&username=Django+Girls&icon_emoji=%3Adjango_heart%3A
-    headers:
-      Accept: ['*/*']
-      Accept-Encoding: ['gzip, deflate']
-      Connection: [keep-alive]
-      Content-Length: ['236']
-      Content-Type: [application/x-www-form-urlencoded]
-      User-Agent: [python-requests/2.12.4]
-    method: POST
-    uri: https://slack.com/api/chat.postMessage
-  response:
-    body:
-      string: !!binary |
-        H4sIAAAAAAAAA6tWys9WskpLzClO1VFKLSrKL1KyUsrLL4lPLC3JSE1RqgUA9xsXwyEAAAA=
-    headers:
-      Access-Control-Allow-Origin: ['*']
-      Connection: [keep-alive]
-      Content-Encoding: [gzip]
-      Content-Length: ['53']
-      Content-Security-Policy: [referrer no-referrer;]
-      Content-Type: [application/json; charset=utf-8]
-      Date: ['Sat, 07 Jan 2017 16:24:33 GMT']
-      Server: [Apache]
-      Strict-Transport-Security: [max-age=31536000; includeSubDomains; preload]
-      Vary: [Accept-Encoding]
-      Via: [1.1 c655546a4cb2031c5c0222e0ad7540da.cloudfront.net (CloudFront)]
-      X-Accepted-OAuth-Scopes: ['chat:write:user']
-      X-Amz-Cf-Id: [QDwQY0P6P9O_jIWFh738XJyYzR_W_QOa6CXDsv1seakqLxT0iPEMvw==]
-      X-Cache: [Miss from cloudfront]
-      X-Content-Type-Options: [nosniff]
-      X-Slack-Backend: [h]
-      X-Slack-Req-Id: [20db712b-37a0-4bc8-acf5-60746be6b9da]
-      X-XSS-Protection: ['0']
-    status: {code: 200, message: OK}
+      access-control-allow-headers:
+      - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
+        x-b3-sampled, x-b3-flags
+      access-control-allow-origin:
+      - '*'
+      access-control-expose-headers:
+      - x-slack-req-id, retry-after
+      cache-control:
+      - private, no-cache, no-store, must-revalidate
+      content-encoding:
+      - gzip
+      content-length:
+      - '53'
+      content-type:
+      - application/json; charset=utf-8
+      date:
+      - Wed, 04 Jan 2023 17:13:49 GMT
+      expires:
+      - Mon, 26 Jul 1997 05:00:00 GMT
+      pragma:
+      - no-cache
+      referrer-policy:
+      - no-referrer
+      server:
+      - Apache
+      strict-transport-security:
+      - max-age=31536000; includeSubDomains; preload
+      vary:
+      - Accept-Encoding
+      via:
+      - envoy-www-iad-btzo, envoy-edge-gru-olp5
+      x-accepted-oauth-scopes:
+      - client
+      x-backend:
+      - main_normal main_bedrock_normal_with_overflow main_canary_with_overflow main_bedrock_canary_with_overflow
+        main_control_with_overflow main_bedrock_control_with_overflow
+      x-content-type-options:
+      - nosniff
+      x-edge-backend:
+      - envoy-www
+      x-envoy-upstream-service-time:
+      - '122'
+      x-powered-by:
+      - HHVM/4.153.1
+      x-robots-tag:
+      - noindex,nofollow
+      x-server:
+      - slack-www-hhvm-main-iad-djbe
+      x-slack-backend:
+      - r
+      x-slack-edge-shared-secret-outcome:
+      - no-match
+      x-slack-req-id:
+      - c25ab90a4edd24554960de3e88f0f17a
+      x-slack-shared-secret-outcome:
+      - no-match
+      x-slack-unique-id:
+      - Y7Wzze8PIqNx27g0KtOVmgAAAB4
+      x-xss-protection:
+      - '0'
+    status:
+      code: 200
+      message: OK
 version: 1