Private
Public Access
1
0

some fixes email processing

This commit is contained in:
Sander Roosendaal
2017-11-10 11:40:47 +01:00
parent 768d1540e6
commit d19ddec79e
5 changed files with 32 additions and 15 deletions

View File

@@ -48,12 +48,6 @@ class DjangoTestCase(TestCase, MockTestCase):
# Create your tests here.
class EmailProcessTest(TestCase):
def test_emailprocessing(self):
out = StringIO()
call_command('processemail', stdout=out)
self.assertIn('Successfully processed email attachments',out.getvalue())
class C2Objects(DjangoTestCase):
def test_strokedata(self):
with open('rowers/testdata/c2stroketestdata.txt','r') as infile:
@@ -336,11 +330,16 @@ class EmailTests(TestCase):
nu = datetime.datetime.now()
workoutsbox = Mailbox.objects.create(name='workouts')
workoutsbox.save()
failbox = Mailbox.objects.create(name='Failed')
failbox.save()
for filename in os.listdir('rowers/testdata/emails'):
m = Message(mailbox=workoutsbox,
from_header = u.email,
subject = filename)
subject = filename,
body="""
chart time
""")
m.save()
a2 = 'media/mailbox_attachments/'+filename
copyfile('rowers/testdata/emails/'+filename,a2)