Private
Public Access
1
0

tests not passing

This commit is contained in:
Sander Roosendaal
2018-11-29 13:17:06 +01:00
parent 7a2f1b951f
commit c361773497

View File

@@ -52,6 +52,7 @@ class DjangoTestCase(TestCase, MockTestCase):
MockTestCase.tearDown(self)
delete_strokedata(1)
# to be done add polar mocks (for email processing)
def mocked_requests(*args, **kwargs):
with open('rowers/testdata/c2jsonworkoutdata.txt','r') as infile:
c2workoutdata = json.load(infile)
@@ -959,6 +960,7 @@ class NewUserRegistrationTest(TestCase):
'tos':True,
'weightcategory':'hwt',
'sex':'male',
'next':'/rowers/list-workouts',
'birthdate':datetime.datetime(year=1970,month=4,day=2)
}
@@ -968,7 +970,7 @@ class NewUserRegistrationTest(TestCase):
response = self.c.post('/rowers/register', form_data, follow=True)
self.assertRedirects(response,
expected_url='/rowers/register/thankyou/',
expected_url='/rowers/me/gdpr-optin/?next=/rowers/list-workouts/',
status_code=302,target_status_code=200)
from django_mailbox.models import Mailbox,MessageAttachment,Message
@@ -1066,6 +1068,7 @@ boattype: 4x
if not os.path.isdir(path):
os.remove(path)
@patch('rowers.c2stuff.requests.get', side_effect=mocked_requests)
def test_emailprocessing(self):
out = StringIO()
call_command('processemail', stdout=out,testing=True)