This document is a reference for common testing patterns in a Django/Python project using Pytest.
Contents:
from time import time | |
import sys | |
import boto3 | |
client = boto3.client('cloudfront') | |
# Uncomment this to pass a URL to the script | |
#def get_id(url): | |
# print("get_id args: {0}".format(url)) | |
# # url: asdf.cloudfront.net | |
# # return: E2134123ASDF |
import functools | |
from django.conf import settings | |
from django.db import transaction, utils | |
def durable(func): | |
""" | |
Decorator to ensure that a function is not being called within an atomic block. |
This document is a reference for common testing patterns in a Django/Python project using Pytest.
Contents:
from typing import Union, List | |
from dataclasses import dataclass | |
class Validations: | |
def __post_init__(self): | |
"""Run validation methods if declared. | |
The validation method can be a simple check | |
that raises ValueError or a transformation to |
(Updated 2022-11-16 with suggestions from comments below, Twitter and Mastodon)
An incomplete list of people in the Python community to follow on Twitter and Mastodon.
With the risk that Twitter dies, I'd be sad to lose links to interesting people in the community, hence this list.
I would love you to comment below with links to people I've missed.