コード例 #1
0
    def test_taxonomy_term_exists_ok(self):
        data = {
            'name': 'new-term-test',
            'label': 'New Term',
            'uri': 'http://localhost.local/newest-term',
            'taxonomy_id': TestValidators.taxonomies[0]['id'],
        }
        res = logic.get_action('taxonomy_term_create')(
            TestValidators.sysadmin_context, data)

        val = taxonomy_term_exists("http://localhost.local/newest-term",
                                   TestValidators.normal_context)
        assert val == "http://localhost.local/newest-term"
コード例 #2
0
    def test_taxonomy_term_exists_ok(self):
        data = {
            'name': 'new-term-test',
            'label': 'New Term',
            'uri': 'http://localhost.local/newest-term',
            'taxonomy_id': TestValidators.taxonomies[0]['id'],
        }
        res = logic.get_action('taxonomy_term_create')(
            TestValidators.sysadmin_context,
            data)

        val = taxonomy_term_exists(
            "http://localhost.local/newest-term",
            TestValidators.normal_context
        )
        assert val == "http://localhost.local/newest-term"
コード例 #3
0
 def test_taxonomy_term_no_value(self):
     val = taxonomy_term_exists(
         "",
         TestValidators.normal_context
     )
コード例 #4
0
 def test_taxonomy_term_missing(self):
     val = taxonomy_term_exists(
         "http://localhost.local/made-up-uri",
         TestValidators.normal_context
     )
コード例 #5
0
 def test_taxonomy_term_no_value(self):
     val = taxonomy_term_exists("", TestValidators.normal_context)
コード例 #6
0
 def test_taxonomy_term_missing(self):
     val = taxonomy_term_exists("http://localhost.local/made-up-uri",
                                TestValidators.normal_context)