'Test include_fields on a wildcard namespace.'

def test_projection_include_wildcard(self):

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