Skip to content

Bug in test_playground/intermediate/boss.py #52

@narrative26

Description

@narrative26

Bug Description
Two helper functions normalize_user_id and compute_tax are defined but never called anywhere in the codebase, leading to incorrect cart file handling and missing tax calculation at checkout.

To Reproduce
Steps to reproduce the behavior:
For normalize_user_id:

  1. Launch the app
  2. Type Student1 in the User ID field and add items to cart
  3. Switch user, type student1 and add items
  4. Notice two separate cart files are created: cart_Student1.json and cart_student1.json, instead of one

For compute_tax:

  1. Launch the app
  2. Add any items to cart
  3. Click Checkout
  4. Notice the total shown and saved to CSV has no tax applied

Expected behavior
normalize_user_id should be called when creating a CartManager so that Student1, STUDENT1, and student1 all map to the same cart file
compute_tax should be called in checkout() so that the final bill includes tax.

Additional context
Both functions have the comment # helper function for practice (UI does not depend on this) suggesting they were intentionally left unconditioned as a practice exercise, but in a real deployment both would cause data integrity issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions