'Test exclude_fields on a wildcard namespace.'

def test_projection_exclude_wildcard(self):

    equivalent_namespace_configs = (NamespaceConfig(exclude_fields=['_id', 'foo', 'nested.field'], namespace_set=['db.*']), NamespaceConfig(namespace_options={'db.*': {'excludeFields': ['_id', 'foo', 'nested.field']}}), NamespaceConfig(exclude_fields=['foo', 'nested.field'], namespace_options={'db.*': {'excludeFields': ['_id', 'foo', 'nested.field']}}))
    for namespace_config in equivalent_namespace_configs:
        self.assertEqual(namespace_config.projection('db.foo'), {'foo': 0, 'nested.field': 0})
        self.assertIsNone(namespace_config.projection('ignored.name'))
