Пример #1
0
    def test_folder_defaults_to_none(self):
        node_settings = GoogleDriveNodeSettings(
            user_settings=self.user_settings)
        node_settings.save()

        assert_is_none(node_settings.folder_id)
        assert_is_none(node_settings.folder_path)
Пример #2
0
    def test_fields(self):
        node_settings = GoogleDriveNodeSettings(user_settings=self.user_settings)
        node_settings.save()

        assert_true(node_settings.user_settings)
        assert_true(hasattr(node_settings, 'folder_id'))
        assert_true(hasattr(node_settings, 'folder_path'))
        assert_true(hasattr(node_settings, 'folder_name'))
        assert_equal(node_settings.user_settings.owner, self.user)
Пример #3
0
    def test_has_auth(self):
        settings = GoogleDriveNodeSettings(user_settings=self.user_settings)
        settings.user_settings.access_token = None
        settings.save()

        assert_false(settings.has_auth)

        settings.user_settings.access_token = '123abc'
        settings.user_settings.save()

        assert_true(settings.has_auth)
Пример #4
0
    def test_folder_defaults_to_none(self):
        node_settings = GoogleDriveNodeSettings(user_settings=self.user_settings)
        node_settings.save()

        assert_is_none(node_settings.folder_id)
        assert_is_none(node_settings.folder_path)