Skip to main content

max / makenotwork

tests: sanitize project slug from underscore usernames in harness create_creator_with_item derived a project slug directly from the username (e.g. seller_vis -> seller_vis-proj), but slug validation rejects underscores, so the db_transactions_layer contract tests failed at project creation. Replace underscores with hyphens when building the slug. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-02 21:50 UTC
Commit: 39e327bf4db3fc05d1bcf119bc7fa6707db6344e
Parent: 6df9789
1 file changed, +4 insertions, -1 deletion
@@ -619,7 +619,10 @@ impl TestHarness {
619 619 ) -> CreatorSetup {
620 620 let user_id = self.create_creator(username).await;
621 621
622 - let slug = format!("{}-proj", username);
622 + // Usernames may contain underscores (valid for accounts) but project
623 + // slugs may not — the slug charset is lowercase letters, digits, and
624 + // hyphens only. Sanitize so a `seller_vis` creator yields `seller-vis-proj`.
625 + let slug = format!("{}-proj", username.replace('_', "-"));
623 626 let resp = self
624 627 .client
625 628 .post_form("/api/projects", &format!("slug={}&title=Test+Project", slug))