diff --git a/OpenBench/tests_pipeline_views.py b/OpenBench/tests_pipeline_views.py index 0de3fb0..71380e3 100644 --- a/OpenBench/tests_pipeline_views.py +++ b/OpenBench/tests_pipeline_views.py @@ -24,16 +24,21 @@ # The Pipeline pages, with a real ( test ) database and the real URL routing. As # in tests_pipelines.py, only the call out to Github is replaced. +import copy import json import re +from html.parser import HTMLParser +from unittest import mock + from django.contrib.auth.models import User from django.test import Client +import OpenBench.config import OpenBench.pipelines as pipelines import OpenBench.tests_pipelines as base -from OpenBench.models import LogEvent, Pipeline, PipelineRun, Profile, StepRun, Test +from OpenBench.models import LogEvent, Network, Pipeline, PipelineRun, Profile, StepRun, Test def make_user(name, enabled=True, approver=False): user = User.objects.create_user(name, '%s@example.com' % (name), 'pw') @@ -54,7 +59,10 @@ class PagesTestCase(base.PipelineTestCase): self.dave = make_user('dave', enabled=False) # A disabled account def client_for(self, user=None, **kwargs): - client = Client(**kwargs) + + # The site sends everything to https, as it is behind a proxy that says that it was. So do the tests + client = Client(HTTP_X_FORWARDED_PROTO='https', **kwargs) + if user is not None: client.force_login(user) return client @@ -571,3 +579,459 @@ class PreviewTests(PagesTestCase): self.assertIn('class="pl-graph"', data['svg']) self.assertNotIn(' could not be found'] + page = self.post({ 'dev_branch' : 'zzz', 'name' : 'nn' }).content.decode() + + self.assertNotIn('