Skip to content

Commit

Permalink
fix tests part 11
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed May 31, 2024
1 parent 2da0c0e commit d99394e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions tests/test_mvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import logging
from typing import Set
from unittest import mock

from flask import Flask, make_response, redirect, session
from flask_appbuilder import AppBuilder
Expand Down Expand Up @@ -173,11 +172,9 @@ def test_list_filter_m_m_invalid_object(self):
"""
with self.app.test_client() as c:
self.browser_login(c, USERNAME_ADMIN, PASSWORD_ADMIN)

# Roles doesn't exists
with mock.patch("flask_appbuilder.models.sqla.filters.log") as log_patch:
rv = c.get("/users/list/?_flt_0_roles=aaaa", follow_redirects=True)
self.assertEqual(rv.status_code, 200)
rv = c.get("/users/list/?_flt_0_roles=aaaa", follow_redirects=True)
self.assertEqual(rv.status_code, 200)

def test_list_filter_o_m_invalid_object_type(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_security_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def test_edit_user(self):
self.assertEqual(rv.status_code, 200)
updated_user = db.session.query(User).get(user_id)
self.assertEqual(len(updated_user.roles), 2)
self.assertEqual(updated_user.roles[0].name, "test-role2")
self.assertEqual(updated_user.roles[1].name, "test-role3")
update_use_roles = sorted([role.name for role in updated_user.roles])
self.assertEqual(update_use_roles, ["test-role2", "test-role3"])
self.assertEqual(updated_user.email, updated_email)

roles = (
Expand Down

0 comments on commit d99394e

Please sign in to comment.