Skip to content

Commit

Permalink
♻️(backend) deprecate has_consent_to_terms for Order model
Browse files Browse the repository at this point in the history
From now on, the terms and conditions (CGV in French) must be
specific to each organization. We can no longer use a global
version for the entire platform. These terms will be included
directly in the contract's context, so the Order model no longer
needs to track user acceptance, as this will happen during contract
signing.

Fix #816
  • Loading branch information
jonathanreveille committed Aug 5, 2024
1 parent b901254 commit bb95e5a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions src/backend/joanie/tests/core/test_models_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,18 +1120,6 @@ def test_models_order_has_unsigned_contract_signature(self):
)
self.assertFalse(order.has_unsigned_contract)

def test_models_order_has_unsigned_contract_product_contract_definition(self):
"""
Check that the `has_unsigned_contract` property returns True
if the order's contract is not signed by student.
"""
order = factories.OrderFactory(
product__contract_definition=factories.ContractDefinitionFactory()
)
self.assertTrue(order.has_unsigned_contract)
with self.assertRaises(Contract.DoesNotExist):
order.contract # pylint: disable=pointless-statement

def test_models_order_has_consent_to_terms_should_raise_deprecation_warning(self):
"""
Due to the refactoring of `has_consent_to_terms` attribute, it is now a deprecated field.
Expand Down
2 changes: 1 addition & 1 deletion src/backend/joanie/tests/swagger/admin-swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7760,4 +7760,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/backend/joanie/tests/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7213,4 +7213,4 @@
}
}
}
}
}

0 comments on commit bb95e5a

Please sign in to comment.