diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2010-10-22 14:14:10 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2010-11-01 10:24:04 -0400 |
commit | ddb04aaac7d9875f1dfd7970944dab6aa6557099 (patch) | |
tree | 0ee4cc15b728dd228fba03083ff4e81b53e572f2 /apps/patchwork/tests/utils.py | |
parent | 3c1fe032cde2289a6ba2f87f09546e646d0e26bb (diff) | |
download | patchwork-ddb04aaac7d9875f1dfd7970944dab6aa6557099.tar.bz2 patchwork-ddb04aaac7d9875f1dfd7970944dab6aa6557099.tar.xz |
Add support for git-pull requests
Add a a pull_url to the Patch object, and update the parser to look for
git-pull style emails.
Requires SQL migration script.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/tests/utils.py')
-rw-r--r-- | apps/patchwork/tests/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/patchwork/tests/utils.py b/apps/patchwork/tests/utils.py index 5dc5d16..a85e168 100644 --- a/apps/patchwork/tests/utils.py +++ b/apps/patchwork/tests/utils.py @@ -22,6 +22,7 @@ import codecs from patchwork.models import Project, Person, UserProfile from django.contrib.auth.models import User +from email import message_from_file try: from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart @@ -91,6 +92,13 @@ def read_patch(filename, encoding = None): return f.read() +def read_mail(filename, project = None): + file_path = os.path.join(_test_mail_dir, filename) + mail = message_from_file(open(file_path)) + if project is not None: + mail['List-Id'] = project.listid + return mail + def create_email(content, subject = None, sender = None, multipart = False, project = None, content_encoding = None): if subject is None: |