#7517 led to this bug.
One might use fixtures to set up project's sites.
Steps to reproduce:
- Create the following initial_data.xml fixture:
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<object pk="1" model="sites.site">
<field type="CharField" name="domain">127.0.0.1:8000</field>
<field type="CharField" name="name">testserver</field>
</object>
</django-objects>
- Run ./manage.py test. The test fails with the following message:
File "/usr/local/lib/python2.5/site-packages/django/contrib/sites/tests.py", line 5, in django.contrib.sites.tests
Failed example:
s
Expected:
<Site: example.com>
Got:
<Site: 127.0.0.1:8000>
The reason is obvious: example.com is hardcoded into doctest.