tests not passing
This commit is contained in:
@@ -52,6 +52,7 @@ class DjangoTestCase(TestCase, MockTestCase):
|
|||||||
MockTestCase.tearDown(self)
|
MockTestCase.tearDown(self)
|
||||||
delete_strokedata(1)
|
delete_strokedata(1)
|
||||||
|
|
||||||
|
# to be done add polar mocks (for email processing)
|
||||||
def mocked_requests(*args, **kwargs):
|
def mocked_requests(*args, **kwargs):
|
||||||
with open('rowers/testdata/c2jsonworkoutdata.txt','r') as infile:
|
with open('rowers/testdata/c2jsonworkoutdata.txt','r') as infile:
|
||||||
c2workoutdata = json.load(infile)
|
c2workoutdata = json.load(infile)
|
||||||
@@ -959,6 +960,7 @@ class NewUserRegistrationTest(TestCase):
|
|||||||
'tos':True,
|
'tos':True,
|
||||||
'weightcategory':'hwt',
|
'weightcategory':'hwt',
|
||||||
'sex':'male',
|
'sex':'male',
|
||||||
|
'next':'/rowers/list-workouts',
|
||||||
'birthdate':datetime.datetime(year=1970,month=4,day=2)
|
'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)
|
response = self.c.post('/rowers/register', form_data, follow=True)
|
||||||
|
|
||||||
self.assertRedirects(response,
|
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)
|
status_code=302,target_status_code=200)
|
||||||
|
|
||||||
from django_mailbox.models import Mailbox,MessageAttachment,Message
|
from django_mailbox.models import Mailbox,MessageAttachment,Message
|
||||||
@@ -1066,6 +1068,7 @@ boattype: 4x
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
|
@patch('rowers.c2stuff.requests.get', side_effect=mocked_requests)
|
||||||
def test_emailprocessing(self):
|
def test_emailprocessing(self):
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
call_command('processemail', stdout=out,testing=True)
|
call_command('processemail', stdout=out,testing=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user