Skip to content

Commit 199821d

Browse files
authored
Merge pull request #93 from ambitioninc/develop
2.2.0
2 parents a7205da + 8094409 commit 199821d

18 files changed

+236
-197
lines changed

.github/workflows/tests.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# copied from django-cte
2+
name: entity_emailer tests
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master,develop]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python: ['3.7', '3.8', '3.9']
16+
# Time to switch to pytest or nose2??
17+
# nosetests is broken on 3.10
18+
# AttributeError: module 'collections' has no attribute 'Callable'
19+
# https://github.com/nose-devs/nose/issues/1099
20+
django:
21+
- 'Django~=3.2.0'
22+
- 'Django~=4.0.0'
23+
- 'Django~=4.1.0'
24+
- 'Django~=4.2.0'
25+
experimental: [false]
26+
# include:
27+
# - python: '3.9'
28+
# django: 'https://github.com/django/django/archive/refs/heads/main.zip#egg=Django'
29+
# experimental: true
30+
# # NOTE this job will appear to pass even when it fails because of
31+
# # `continue-on-error: true`. Github Actions apparently does not
32+
# # have this feature, similar to Travis' allow-failure, yet.
33+
# # https://github.com/actions/toolkit/issues/399
34+
exclude:
35+
- python: '3.7'
36+
django: 'Django~=4.0.0'
37+
- python: '3.7'
38+
django: 'Django~=4.1.0'
39+
- python: '3.7'
40+
django: 'Django~=4.2.0'
41+
services:
42+
postgres:
43+
image: postgres:latest
44+
env:
45+
POSTGRES_DB: postgres
46+
POSTGRES_PASSWORD: postgres
47+
POSTGRES_USER: postgres
48+
ports:
49+
- 5432:5432
50+
options: >-
51+
--health-cmd pg_isready
52+
--health-interval 10s
53+
--health-timeout 5s
54+
--health-retries 5
55+
steps:
56+
- uses: actions/checkout@v3
57+
- uses: actions/setup-python@v3
58+
with:
59+
python-version: ${{ matrix.python }}
60+
- name: Setup
61+
run: |
62+
python --version
63+
pip install --upgrade pip wheel
64+
pip install -r requirements/requirements.txt
65+
pip install -r requirements/requirements-testing.txt
66+
pip install "${{ matrix.django }}"
67+
pip freeze
68+
- name: Run tests
69+
env:
70+
DB_SETTINGS: >-
71+
{
72+
"ENGINE":"django.db.backends.postgresql_psycopg2",
73+
"NAME":"entity_emailer",
74+
"USER":"postgres",
75+
"PASSWORD":"postgres",
76+
"HOST":"localhost",
77+
"PORT":"5432"
78+
}
79+
run: |
80+
coverage run manage.py test entity_emailer
81+
coverage report --fail-under=99
82+
continue-on-error: ${{ matrix.experimental }}
83+
- name: Check style
84+
run: flake8 entity_emailer

entity_emailer/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# flake8: noqa
22
from .version import __version__
3-
4-
default_app_config = 'entity_emailer.apps.EntityEmailerConfig'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Generated by Django 3.2.19 on 2023-06-01 13:10
2+
3+
import datetime
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import uuid
7+
8+
9+
class Migration(migrations.Migration):
10+
replaces = [('entity_emailer', '0001_initial'),
11+
('entity_emailer', '0002_auto_20170919_1653'),
12+
('entity_emailer', '0003_email_exception'),
13+
('entity_emailer', '0004_email_num_tries')]
14+
15+
dependencies = [
16+
('entity_event', '0001_initial'),
17+
('entity', '0001_initial'),
18+
]
19+
20+
operations = [
21+
migrations.CreateModel(
22+
name='Email',
23+
fields=[
24+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('view_uid', models.UUIDField(default=uuid.uuid4, editable=False)),
26+
('subject', models.CharField(max_length=256)),
27+
('from_address', models.CharField(default='', max_length=256)),
28+
('uid', models.CharField(default=None, max_length=100, null=True, unique=True)),
29+
('scheduled', models.DateTimeField(default=datetime.datetime.utcnow, null=True)),
30+
('sent', models.DateTimeField(default=None, null=True)),
31+
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='entity_event.event')),
32+
('recipients', models.ManyToManyField(to='entity.Entity')),
33+
('exception', models.TextField(default=None, null=True)),
34+
('num_tries', models.IntegerField(default=0)),
35+
],
36+
),
37+
]

entity_emailer/migrations/0001_initial.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

entity_emailer/migrations/0002_auto_20170919_1653.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

entity_emailer/migrations/0003_email_exception.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

entity_emailer/migrations/0004_email_num_tries.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

entity_emailer/signals.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33

44
# An event that will be fired prior to an email being sent
5-
pre_send = Signal(providing_args=['email', 'event', 'context', 'message'])
5+
pre_send = Signal()
6+
"""providing_args=['email', 'event', 'context', 'message']"""
67

78
# An event that will be fired if an exception occurs when trying to send an email
8-
email_exception = Signal(providing_args=['email', 'exception'])
9+
email_exception = Signal()
10+
"""providing_args=['email', 'exception']"""

0 commit comments

Comments
 (0)