Esempio n. 1
0
    def test_has_auth(self):
        node_settings = AddonDataverseNodeSettings()
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings = AddonDataverseUserSettings()
        user_settings.save()
        node_settings.user_settings = user_settings
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings.api_token = 'foo-bar'
        user_settings.save()
        assert_true(node_settings.has_auth)
Esempio n. 2
0
    def test_has_auth(self):
        node_settings = AddonDataverseNodeSettings()
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings = AddonDataverseUserSettings()
        user_settings.save()
        node_settings.user_settings = user_settings
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings.dataverse_username = '******'
        user_settings.dataverse_password = '******'
        user_settings.save()
        assert_true(node_settings.has_auth)
Esempio n. 3
0
    def test_has_auth(self):
        node_settings = AddonDataverseNodeSettings()
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings = AddonDataverseUserSettings()
        user_settings.save()
        node_settings.user_settings = user_settings
        node_settings.save()
        assert_false(node_settings.has_auth)

        user_settings.dataverse_username = '******'
        user_settings.dataverse_password = '******'
        user_settings.save()
        assert_true(node_settings.has_auth)