Conversation
This lets the signals be sent when running non-wagtail admin codepaths.
0a987a7 to
584053f
Compare
…d reusing stock delete functionality
The MP_Node factories need `parent` in `django_get_or_create`, and to be using `TreeQuerySet` else the needed methods don't exist.
Because the topic tree hides the root node in a number core method, it gets corrupted during deletion.
This keeps the command parts separate
By default, they enqueue tasks when instances are saved, which is unnecessary when many of the instances are about to be deleted.
This factory is definitely configured incorrectly, but something about the model, dependent tests or factory itself requires that it work this way.
They may not have been indexed yet
No need to be less informative when actually deleting.
|
|
||
| class PageCreationConfig(ModelCreationConfig): | ||
| published: FractionalFloat = 0.5 | ||
| revisions: NonNegativeInt | RangeConfig = 0 |
There was a problem hiding this comment.
Unless I misunderstood, aren't all Pages guaranteed to have at least one revision in a normal environment?
There was a problem hiding this comment.
I think the revision is the history, so the first draft save of a page won't necessarily have a revision. That's my understanding at least, I may very well be wrong.
There was a problem hiding this comment.
I did a test and it seems that every page has at least one revision:
- I created a draft page by entering basic information in a new page view and clicking "Save Draft"
- Grabbed the ID from the URL (
28) - Ran the following:
len(InformationPage.objects.get(pk=28).revisions.all()) - Returns
1
So I think we get the first revision for free and the range should start at 1 (and we should add n-1 additional revisions)
There was a problem hiding this comment.
TIL. Thanks for looking into this. Yeah I agree this should be tweaked.
There was a problem hiding this comment.
It seems that's only true when creating pages through the CMS - here there's no revision automatically created, so 0 is still valid.
What is the context of this PR?
We need a way to create test data in bulk for performance testing etc.
https://officefornationalstatistics.atlassian.net/browse/CMS-948
Data creation is seeded, meaning it can be recreated reliably.
Data is identified by a prefix. To save complexity, it's only possible to delete all test data, rather than specific seeds.
How to review
There are 2 new management commands.
create_test_datacreates data based on a seed.delete_test_dataremoves all test data from the system (based on the prefix)Follow-up Actions
List any follow-up actions (if applicable), like needed documentation updates or additional testing.