Ejemplo n.º 1
0
    def test_facet_dict_is_left_empty(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.organization_facets({},
                                                 'organization',
                                                 'dataset')

        self.assertEquals(facets_dict, {})
Ejemplo n.º 2
0
    def test_groups_renamed_events(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.organization_facets(self.default_facet_titles,
                                                 'organization',
                                                 'dataset')

        self.assertEquals(facets_dict['groups'], 'Events')
Ejemplo n.º 3
0
    def test_removes_groups(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.group_facets(self.default_facet_titles,
                                          'event',
                                          'dataset')

        self.assertTrue('groups' not in facets_dict)
    def test_form_to_db_schema_options_not_api_allows_created(self):
        plugin = MapactioneventPlugin()

        options = {'api': False}

        schema = plugin.form_to_db_schema_options(options)

        self.assertTrue(ignore not in schema['created'])
    def test_form_to_db_schema_options_api_update_ignores_created(self):
        plugin = MapactioneventPlugin()

        options = {'api': 'something', 'type': 'update'}

        schema = plugin.form_to_db_schema_options(options)

        self.assertTrue(ignore in schema['created'])
Ejemplo n.º 6
0
    def test_form_to_db_schema_options_not_api_allows_created(self):
        plugin = MapactioneventPlugin()

        options = {'api': False}

        schema = plugin.form_to_db_schema_options(options)

        self.assertTrue(ignore not in schema['created'])
Ejemplo n.º 7
0
    def test_form_to_db_schema_options_api_update_ignores_created(self):
        plugin = MapactioneventPlugin()

        options = {'api': 'something',
                   'type': 'update'}

        schema = plugin.form_to_db_schema_options(options)

        self.assertTrue(ignore in schema['created'])
    def test_form_to_db_schema_options_returns_schema(self):
        plugin = MapactioneventPlugin()

        my_schema = {'my schema': 'foo'}

        options = {'context': {'schema': my_schema}}

        schema = plugin.form_to_db_schema_options(options)

        self.assertEqual(schema, my_schema)
Ejemplo n.º 9
0
    def test_form_to_db_schema_options_returns_schema(self):
        plugin = MapactioneventPlugin()

        my_schema = {'my schema': 'foo'}

        options = {'context': {'schema': my_schema}}

        schema = plugin.form_to_db_schema_options(options)

        self.assertEqual(schema, my_schema)
Ejemplo n.º 10
0
    def test_facet_dict_is_left_empty(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.dataset_facets({}, 'dataset')

        self.assertEquals(facets_dict, {})
Ejemplo n.º 11
0
    def test_form_to_db_schema_allows_created(self):
        plugin = MapactioneventPlugin()
        schema = plugin.form_to_db_schema()

        self.assertTrue(ignore not in schema['created'])
Ejemplo n.º 12
0
    def test_groups_renamed_events(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.dataset_facets(self.default_facet_titles,
                                            'dataset')

        self.assertEquals(facets_dict['groups'], 'Events')
Ejemplo n.º 13
0
    def test_removes_groups(self):
        plugin = MapactioneventPlugin()
        facets_dict = plugin.group_facets(self.default_facet_titles, 'event',
                                          'dataset')

        self.assertTrue('groups' not in facets_dict)
Ejemplo n.º 14
0
    def test_form_to_db_schema_allows_created(self):
        plugin = MapactioneventPlugin()
        schema = plugin.form_to_db_schema()

        self.assertTrue(ignore not in schema['created'])