You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""A helper decorator that checks that every model that a test "targeted" was actually seen in the output, ensuring that we're actually testing the thing we think are. Additionally, this decorator is easily legible to static analysis, which allows for static checks to ensure that all `__include_in_export__ = True` models are being tested."""
29
+
deftargets_models(*expected_models: Type):
30
+
"""A helper decorator that checks that every model that a test "targeted" was actually seen in
31
+
the output, ensuring that we're actually testing the thing we think we are. Additionally, this
32
+
decorator is easily legible to static analysis, which allows for static checks to ensure that
33
+
all `__include_in_export__ = True` models are being tested."""
31
34
32
35
defdecorator(func):
33
36
defwrapped(*args, **kwargs):
@@ -60,14 +63,17 @@ def setUp(self):
60
63
61
64
defimport_export_then_validate(self) ->JSONData:
62
65
"""Test helper that validates that data imported from a temporary `.json` file correctly
63
-
matches the actual outputted export data."""
66
+
matches the actual outputted export data.
67
+
68
+
Return the actual JSON, so that we may use the `@targets_models` decorator to ensure that
69
+
we have at least one instance of all the "tested for" models in the actual output."""
0 commit comments