Fixed errors in tests

This commit is contained in:
PV Tejas 2026-02-27 20:13:10 +05:30
parent daed360fb6
commit ed71714a79
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ bp = Blueprint('auth', __name__, url_prefix='/auth')
@bp.route('/register', methods=('GET', 'POST')) @bp.route('/register', methods=('GET', 'POST'))
def register(): def register():
return "Admin only", 403 # return "Admin only", 403
if request.method == 'POST': if request.method == 'POST':
username = request.form['username'] username = request.form['username']
password = request.form['password'] password = request.form['password']

View file

@ -58,7 +58,7 @@ def test_create(client, auth, app):
def test_update(client, auth, app): def test_update(client, auth, app):
auth.login() auth.login()
assert client.get('/1/update').status_code == 200 assert client.get('/1/update').status_code == 200
client.post('/1/update', data={'title': 'updated', 'body': ''}) client.post('/1/update', data={'title': 'updated', 'body': '', 'created': '1970-01-01 00:00:00'})
with app.app_context(): with app.app_context():
db = get_db() db = get_db()
@ -71,7 +71,7 @@ def test_update(client, auth, app):
)) ))
def test_create_update_validate(client, auth, path): def test_create_update_validate(client, auth, path):
auth.login() auth.login()
response = client.post(path, data={'title': '', 'body': ''}) response = client.post(path, data={'title': '', 'body': '', 'created': '1970-01-01 00:00:00'})
assert b'Title is required.' in response.data assert b'Title is required.' in response.data
def test_delete(client, auth, app): def test_delete(client, auth, app):