Skip to content

Commit

Permalink
test: Reduce flaky integration tests triggered by test_get_tag (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianliebscher authored and josedev-union committed Jan 22, 2024
1 parent e8ca558 commit c6e2486
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/integration_tests/tags/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
# isort:skip_file
"""Unit tests for Superset"""
import json
from datetime import datetime

from flask import g
import pytest
import prison
from freezegun import freeze_time
from sqlalchemy.sql import func
from sqlalchemy import and_
from superset.models.dashboard import Dashboard
Expand Down Expand Up @@ -121,13 +123,14 @@ def test_get_tag(self):
"""
Query API: Test get query
"""
tag = self.insert_tag(
name="test get tag",
tag_type="custom",
)
self.login(username="admin")
uri = f"api/v1/tag/{tag.id}"
rv = self.client.get(uri)
with freeze_time(datetime.now()):
tag = self.insert_tag(
name="test get tag",
tag_type="custom",
)
self.login(username="admin")
uri = f"api/v1/tag/{tag.id}"
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 200)
expected_result = {
"changed_by": None,
Expand Down

0 comments on commit c6e2486

Please sign in to comment.