11 / 20Module 1: A Rell backend with FT4 accounts
Update tests
Operations protected by FT4 authentication need extra setup in your tests. Inside the same transaction, call ft_auth_operation_for right before the operation you want to test.
First, import ft_auth_operation_for from the FT4 test utilities:
import lib.ft4.test.core.{ ft_auth_operation_for };Then, in every test, call ft_auth_operation_for to simulate the authentication that the operation expects. It prepares the authentication state so the operation runs as intended.
For example, if an operation requires FT4 authentication, place the ft_auth_operation_for call directly before that operation in the transaction block.
The next lesson splits the app into several modules to give it a cleaner structure.
Written for this site from Chromia’s public course. Code samples are the course’s own.