def coerce(self, v): return text_type(v)
def __repr__(self): v = self.get() return text_type(v)
def test_hook_str(self): domain = 'test.foo.com' self.client.get('/', HTTP_HOST=domain) self.assertEquals(hook_str(domain), text_type(settings.DOMAINS_TEST_ATTRIBUTE_STR))