def test_is_configured(self):
        # If an ExternalIntegration exists, the API is_configured
        assert True == NoveListAPI.is_configured(self._default_library)
        # A class variable is set to reduce future database requests.
        assert self._default_library.id == NoveListAPI._configuration_library_id

        # If an ExternalIntegration doesn't exist for the library, it is not.
        library = self._library()
        assert False == NoveListAPI.is_configured(library)
        # And the class variable is updated.
        assert library.id == NoveListAPI._configuration_library_id
Example #2
0
    def test_is_configured(self):
        # If an ExternalIntegration exists, the API is_configured
        eq_(True, NoveListAPI.is_configured(self._default_library))
        # A class variable is set to reduce future database requests.
        eq_(self._default_library.id, NoveListAPI._configuration_library_id)

        # If an ExternalIntegration doesn't exist for the library, it is not.
        library = self._library()
        eq_(False, NoveListAPI.is_configured(library))
        # And the class variable is updated.
        eq_(library.id, NoveListAPI._configuration_library_id)
    def test_is_configured(self):
        # If an ExternalIntegration exists, the API is_configured
        eq_(True, NoveListAPI.is_configured(self._default_library))
        # A class variable is set to reduce future database requests.
        eq_(self._default_library.id, NoveListAPI._configuration_library_id)

        # If an ExternalIntegration doesn't exist for the library, it is not.
        library = self._library()
        eq_(False, NoveListAPI.is_configured(library))
        # And the class variable is updated.
        eq_(library.id, NoveListAPI._configuration_library_id)