Towards Parametrizing Fixtures and Test Functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 5

  • @arvinmaltezobareng2629
    @arvinmaltezobareng2629 3 ปีที่แล้ว +3

    Hmmm weird but for some reason my category attribute refuses to accept 1 as it's value it says: "Cannot assign 1: Product.category must be a Category instance" I know it wants an actual Category object but how do I do create and/or use the Category object inside the parameterize decorator?

    • @LegionLeague
      @LegionLeague 3 ปีที่แล้ว

      You must have put 'category=category' in the test = product_factory(...) bit. It needs to be 'category_id=category'

  • @mueezkhan280
    @mueezkhan280 2 ปีที่แล้ว +1

    can serializers also be tested in the way you showed how to test forms ?

  • @internetbro6519
    @internetbro6519 ปีที่แล้ว

    can we get a link to the e-commerce project example codebase? thank you for your awesomness!

    • @sonamkawade3412
      @sonamkawade3412 ปีที่แล้ว

      please shear the e-commerce project link.