mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
refactor(test): add login_as_admin in global conftest (#20703)
This commit is contained in:
@@ -14,11 +14,20 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
"""
|
||||
Here is where we create the app which ends up being shared across all tests.integration_tests. A future
|
||||
optimization will be to create a separate app instance for each test class.
|
||||
"""
|
||||
from superset.app import create_app
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
from flask.testing import FlaskClient
|
||||
|
||||
app = create_app()
|
||||
|
||||
|
||||
def login(
|
||||
client: "FlaskClient[Any]", username: str = "admin", password: str = "general"
|
||||
):
|
||||
resp = client.post("/login/", data=dict(username=username, password=password))
|
||||
assert "User confirmation needed" not in resp
|
||||
|
||||
Reference in New Issue
Block a user