At the unit test level, you can create another database in the `tests.py` settings for `read_replica`, then use `@override_settings` to test both branches of the "if" statement.

You'll also need to test it against an RDS instance.  I'd suggest creating a sandbox, then updating the settings on the box to point to the prod read-replica.

Have you coordinated with ops about updating the auth tokens to add the `read_replica` database to the settings in prod?