def METHOD_NAME(self):
    with pytest.raises(IntegrityError) as excinfo:
        UserAlias.objects.create(
            alias_name=self.VALID_ALIAS_NAME,
            alias_of=self.default_user
        )
        UserAlias.objects.create(
            alias_name=self.VALID_ALIAS_NAME,
            alias_of=self.another_user
        )
    assert str(excinfo.value) == (
        'duplicate key value violates unique constraint '
        '"main_useralias_alias_name_key"\n'
        'DETAIL:  Key (alias_name)=({duplicated_name}) already exists.\n'
    ).format(
        duplicated_name=self.VALID_ALIAS_NAME
    )