1👍
✅
Use a mock request
that gives you deterministic data, without connecting to the internet. For example, make a request
object that returns some fixed string for request.META
, and a session
object that returns a fixed string for session.get(...)
, etc. Then assert that self.active_lang
and other properties that need to be set have the right values.
Source:stackexchange.com