Skip to content

Commit 6dad68f

Browse files
committed
3.2.2 patch
1 parent 0d34353 commit 6dad68f

File tree

5 files changed

+103
-20
lines changed

5 files changed

+103
-20
lines changed

mail_panel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.1'
1+
__version__ = '3.2.2'

poetry.lock

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-mail-panel"
3-
version = "3.2.1"
3+
version = "3.2.2"
44
description = "A panel for django-debug-toolbar that allows for viewing of recently sent email."
55
authors = ["Stephen Mitchell"]
66
license = "Apache Software License"
@@ -34,6 +34,7 @@ packages = [
3434

3535
[tool.poetry.dependencies]
3636
python = "^3.3"
37+
django-debug-toolbar = ">=1.0"
3738

3839
[tool.poetry.dev-dependencies]
3940

test_build.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
#!/bin/bash
22

33
# Usage: ./test_build.sh [2|3]
4-
# Builds package and tests wheel in python 2 and 3
5-
# Add 2 or 3 to test a particular version of python
4+
# Builds package and tests wheel
65

7-
# python3 setup.py sdist bdist_wheel
6+
python3 setup.py sdist bdist_wheel
87

9-
# export DJANGO_SETTINGS_MODULE='tests.settings'
10-
# TEST="tests"
11-
# echo $TEST
8+
export DJANGO_SETTINGS_MODULE='tests.settings'
9+
TEST="tests"
10+
echo $TEST
1211

13-
# FILE=`ls -1 dist/*.whl | tail -n 1`
14-
# echo "Verifying build of $FILE"
12+
FILE=`ls -1 dist/*.whl | tail -n 1`
13+
echo "Verifying build of $FILE"
1514

16-
# if [ -z "$1" ] || [ "$1" -eq "3" ]; then
17-
# echo "# Installing virtualenv for Python 3"
18-
# rm -rf 3-sdist # ensure clean state if ran repeatedly
19-
# virtualenv -p python3 3-sdist
15+
if [ -z "$1" ] || [ "$1" -eq "3" ]; then
16+
echo "# Installing virtualenv for Python 3"
17+
rm -rf 3-sdist # ensure clean state if ran repeatedly
18+
virtualenv -p python3 3-sdist
2019

21-
# echo "# Install Python 3 requirements"
22-
# 3-sdist/bin/pip3 install django $FILE
20+
echo "# Install Python 3 requirements"
21+
3-sdist/bin/pip3 install django $FILE
2322

24-
# echo "# Run command with Python 3"
25-
# 3-sdist/bin/python3 -m "$TEST"
23+
echo "# Run command with Python 3"
24+
3-sdist/bin/python3 -m "$TEST"
2625

27-
# echo "# Test using Python 3 ended"
28-
# fi
26+
echo "# Test using Python 3 ended"
27+
fi

tests/test_toolbar.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from django.core import mail
1010
from mail_panel.backend import MailToolbarBackendEmail, MailToolbarBackend
1111
from mail_panel.panels import MailToolbarPanel
12+
from mail_panel.utils import clear_outbox
1213

1314
from django.test.client import RequestFactory
1415
rf = RequestFactory()
@@ -61,8 +62,25 @@ def test_panel(self):
6162
self.assertEqual(p.toolbar, self.toolbar)
6263

6364
def test_generate_stats(self):
65+
66+
clear_outbox()
67+
6468
p = MailToolbarPanel(*self.panel_args)
69+
70+
# Test empty indox
71+
p.generate_stats(None, None)
72+
self.assertEqual(len(p.mail_list), 0)
73+
74+
75+
# Test inbox with one message
76+
fake_message = self.get_fake_message()
77+
backend = MailToolbarBackend()
78+
backend.send_messages([fake_message])
79+
6580
p.generate_stats(None, None)
81+
self.assertEqual(len(p.mail_list), 1)
82+
83+
6684

6785
def test_process_response(self):
6886
p = MailToolbarPanel(*self.panel_args)

0 commit comments

Comments
 (0)