We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab79cb7 commit d037494Copy full SHA for d037494
1 file changed
recoco/apps/metrics/tests/test_command.py
@@ -1,3 +1,4 @@
1
+import os
2
import random
3
import string
4
from io import StringIO
@@ -56,6 +57,17 @@ def test_full_command(self, settings):
56
57
)
58
assert cursor.fetchone()[0] == 0
59
60
+ @pytest.mark.skipif(
61
+ os.environ.get("SKIP_TEST_METRICS_CREATE_ROLES") == "true",
62
+ reason="Skipping metrics tests that create roles",
63
+ )
64
+ @pytest.mark.django_db(transaction=True)
65
+ def test_full_command_create_roles(self, settings):
66
+ random_prefix = "".join(
67
+ random.choices(string.ascii_lowercase, k=10) # noqa: S311
68
69
+ settings.METRICS_PREFIX = f"metrics_{random_prefix}"
70
+
71
call_command("update_materialized_views", create_roles=True)
72
73
with connection.cursor() as cursor:
0 commit comments