Private
Public Access
1
0

Merge branch 'develop' into feature/testcoverage

This commit is contained in:
Sander Roosendaal
2021-01-16 11:04:36 +01:00
6 changed files with 16 additions and 2525 deletions

View File

@@ -41,6 +41,7 @@ from mock import Mock, patch
import pandas as pd
import rowers.c2stuff as c2stuff
import arrow
from django.http import HttpResponseRedirect
import json
import numpy as np
@@ -172,6 +173,9 @@ def mocked_read_df_sql(id):
return df
def mocked_sendmail(*args,**kwargs):
return HttpResponseRedirect('/rowers/email/')
def mocked_get_video_data(*args, **kwargs):
with open('rowers/tests/testdata/videodata.json','r') as infile:
data = json.load(infile)

View File

@@ -260,13 +260,15 @@ class URLTests(TestCase):
@patch('requests.get',side_effect=mocked_requests)
@patch('requests.post',side_effect=mocked_requests)
@patch('rowers.dataprep.get_video_data',side_effect=mocked_get_video_data)
@patch('rowers.views.statements.sendmail',side_effect=mocked_sendmail)
def test_url_generator(self,url,expected,
mocked_sqlalchemy,
mocked_read_df_sql,
mocked_getsmallrowdata_db,
mock_get,
mock_post,
mocked_get_video_data):
mocked_get_video_data,
mocked_sendmail):
if url not in tested:
login = self.c.login(username='john',password='koeinsloot')