Add test coverage for the faction phase. Simultaneously refactor related functions so that the main ones are suitable for being called from outside the HTTP cycle, such as when using the Django interactive console or in Django tests. When refactoring, ensure that the functions comply with the single-responsibility principle.
Add test coverage for the faction phase. Simultaneously refactor related functions so that the main ones are suitable for being called from outside the HTTP cycle, such as when using the Django interactive console or in Django tests. When refactoring, ensure that the functions comply with the single-responsibility principle.