Cleanup tests

This commit is contained in:
jmartin 2014-11-07 14:21:01 +01:00
parent 87b2e8bdd9
commit ef4a32ba13
4 changed files with 12 additions and 22 deletions

View File

@ -0,0 +1,3 @@
Version 3.4.0 - 2014-11-05

View File

@ -4,7 +4,7 @@
from StringIO import StringIO
from csv import reader
from datetime import datetime
from trytond.config import CONFIG
from trytond.config import config
from trytond.model import ModelSQL, ModelView, fields, Workflow
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, If
@ -166,7 +166,7 @@ class CSVArchive(Workflow, ModelSQL, ModelView):
def get_data(self, name):
cursor = Transaction().cursor
path = os.path.join(CONFIG.get('data_path', '/var/lib/trytond'),
path = os.path.join(config.get('data_path', '/var/lib/trytond'),
cursor.database_name, 'csv_import')
archive = '%s/%s' % (path, self.archive_name.replace(' ', '_'))
try:
@ -181,7 +181,7 @@ class CSVArchive(Workflow, ModelSQL, ModelView):
@classmethod
def set_data(cls, archives, name, value):
cursor = Transaction().cursor
path = os.path.join(CONFIG.get('data_path', '/var/lib/trytond'),
path = os.path.join(config.get('data_path', '/var/lib/trytond'),
cursor.database_name, 'csv_import')
if not os.path.exists(path):
os.makedirs(path, mode=0777)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
#This file is part csv_import module for Tryton.
#The COPYRIGHT file at the top level of this repository contains
#the full copyright notices and license terms.
# This file is part csv_import module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
from setuptools import setup
import re
import os

View File

@ -1,13 +1,6 @@
# This file is part of csv_import module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
import sys
import os
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
'..', '..', '..', '..', '..', 'trytond')))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
import unittest
import doctest
import trytond.tests.test_tryton
@ -16,23 +9,17 @@ from trytond.backend.sqlite.database import Database as SQLiteDatabase
class CSVImportTestCase(unittest.TestCase):
'''
Test CSV Import module.
'''
'Test CSV Import module'
def setUp(self):
trytond.tests.test_tryton.install_module('csv_import')
def test0005views(self):
'''
Test views.
'''
'Test views'
test_view('csv_import')
def test0006depends(self):
'''
Test depends.
'''
'Test depends'
test_depends()