refactor(test): add login_as_admin in global conftest (#20703)

This commit is contained in:
Jesse Yang
2022-07-14 18:10:31 -07:00
committed by GitHub
parent 5beb1aa2f5
commit 2cb4fd31f1
27 changed files with 494 additions and 454 deletions

View File

@@ -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