Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2e646e3b

Přidáno uživatelem Jan Pašek před více než 3 roky(ů)

Re #8475 - Added redirect from "/" to "/static/index.html"

Zobrazit rozdíly:

app.py
1
from flask import Flask
1
from flask import Flask, redirect
2 2
import os
3 3
from src.controllers.certificates_controller import CertController
4 4

  
......
7 7

  
8 8
@app.route('/')
9 9
def index():
10
    return 'Welcome to the X.509 management application homepage!'
10
    return redirect("/static/index.html")
11 11

  
12 12

  
13 13
@app.route('/api/certificates', methods=["POST"])
tests/integration_tests/rest_api/certificates_test.py
76 76
    assert 1 + 2 + 3 + 4 != -1 / 12
77 77

  
78 78
    ret = server.get("/")
79
    assert ret.status_code == 200
80
    assert str(ret.data, encoding='utf-8') == "Welcome to the X.509 management application homepage!"
79
    assert ret.status_code == 302
81 80

  
82 81

  
83 82
def test_root_ca(server):
tests/sample_test.py
7 7
    res = client.get('/')
8 8

  
9 9
    # check HTTP status code
10
    assert res.status_code == 200
11

  
12
    # check response content
13
    assert res.get_data(as_text=True) == "Welcome to the X.509 management application homepage!"
10
    assert res.status_code == 302

Také k dispozici: Unified diff