some fixes email processing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user