Changeset 12076 for main


Ignore:
Timestamp:
28 Nov 2014, 06:56:38 (10 years ago)
Author:
Henrik Bettermann
Message:

Singular not plural.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py

    r12056 r12076  
    114114
    115115
    116 class CustomersExporter(grok.GlobalUtility, CustomerExporterBase):
     116class CustomerExporter(grok.GlobalUtility, CustomerExporterBase):
    117117    """Exporter for Customers.
    118118    """
     
    134134            value = str('%s#' % value)
    135135        return super(
    136             CustomersExporter, self).mangle_value(
     136            CustomerExporter, self).mangle_value(
    137137            value, name, context=context)
    138138
    139 class CustomerDocumentsExporter(grok.GlobalUtility, CustomerExporterBase):
     139class CustomerDocumentExporter(grok.GlobalUtility, CustomerExporterBase):
    140140    """Exporter for CustomerDocument instances.
    141141    """
     
    169169                value = getattr(customer, name, None)
    170170        return super(
    171             CustomerDocumentsExporter, self).mangle_value(
     171            CustomerDocumentExporter, self).mangle_value(
    172172            value, name, context=context)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py

    r12057 r12076  
     1## $Id$
     2##
     3## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
     4## This program is free software; you can redistribute it and/or modify
     5## it under the terms of the GNU General Public License as published by
     6## the Free Software Foundation; either version 2 of the License, or
     7## (at your option) any later version.
     8##
     9## This program is distributed in the hope that it will be useful,
     10## but WITHOUT ANY WARRANTY; without even the implied warranty of
     11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12## GNU General Public License for more details.
     13##
     14## You should have received a copy of the GNU General Public License
     15## along with this program; if not, write to the Free Software
     16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     17##
     18"""
     19Test the customer exporter.
     20"""
     21
    122import os
    223import grok
     
    1031from waeup.ikoba.customers.catalog import CustomersQuery
    1132from waeup.ikoba.customers.export import (
    12     CustomersExporter, CustomerDocumentsExporter, get_customers)
     33    CustomerExporter, CustomerDocumentExporter, get_customers)
    1334from waeup.ikoba.customers.interfaces import ICSVCustomerExporter
    1435from waeup.ikoba.customers.customer import Customer
     
    3859        return
    3960
    40 class CustomersExporterTest(CustomerImportExportSetup):
     61class CustomerExporterTest(CustomerImportExportSetup):
    4162
    4263    layer = FunctionalLayer
    4364
    4465    def setUp(self):
    45         super(CustomersExporterTest, self).setUp()
     66        super(CustomerExporterTest, self).setUp()
    4667        self.setup_for_export()
    4768        return
     
    4970    def test_ifaces(self):
    5071        # make sure we fullfill interface contracts
    51         obj = CustomersExporter()
     72        obj = CustomerExporter()
    5273        verifyObject(ICSVCustomerExporter, obj)
    53         verifyClass(ICSVCustomerExporter, CustomersExporter)
     74        verifyClass(ICSVCustomerExporter, CustomerExporter)
    5475        return
    5576
     
    6485        # set values we can expect in export file
    6586        self.setup_customer(self.customer)
    66         exporter = CustomersExporter()
     87        exporter = CustomerExporter()
    6788        exporter.export([self.customer], self.outfile)
    6889        result = open(self.outfile, 'rb').read()
     
    81102        # set values we can expect in export file
    82103        self.setup_customer(self.customer)
    83         exporter = CustomersExporter()
     104        exporter = CustomerExporter()
    84105        exporter.export_all(self.app, self.outfile)
    85106        result = open(self.outfile, 'rb').read()
     
    96117        # we can export a single customer
    97118        self.setup_customer(self.customer)
    98         exporter = CustomersExporter()
     119        exporter = CustomerExporter()
    99120        exporter.export_customer(self.customer, self.outfile)
    100121        result = open(self.outfile, 'rb').read()
     
    108129        return
    109130
    110 class CustomerDocumentsExporterTest(CustomerImportExportSetup):
     131class CustomerDocumentExporterTest(CustomerImportExportSetup):
    111132
    112133    layer = FunctionalLayer
    113134
    114135    def setUp(self):
    115         super(CustomerDocumentsExporterTest, self).setUp()
     136        super(CustomerDocumentExporterTest, self).setUp()
    116137        self.setup_for_export()
    117138        return
     
    119140    def test_ifaces(self):
    120141        # make sure we fullfill interface contracts
    121         obj = CustomerDocumentsExporter()
     142        obj = CustomerDocumentExporter()
    122143        verifyObject(ICSVCustomerExporter, obj)
    123         verifyClass(ICSVCustomerExporter, CustomerDocumentsExporter)
     144        verifyClass(ICSVCustomerExporter, CustomerDocumentExporter)
    124145        return
    125146
     
    133154        # we can export a nearly empty document
    134155        document = CustomerSampleDocument()
    135         exporter = CustomerDocumentsExporter()
     156        exporter = CustomerDocumentExporter()
    136157        exporter.export([document], self.outfile)
    137158        result = open(self.outfile, 'rb').read()
     
    148169        self.setup_customer(self.customer)
    149170        document = self.customer['documents']['d101']
    150         exporter = CustomerDocumentsExporter()
     171        exporter = CustomerDocumentExporter()
    151172        exporter.export([document], self.outfile)
    152173        result = open(self.outfile, 'rb').read()
     
    167188        # set values we can expect in export file
    168189        self.setup_customer(self.customer)
    169         exporter = CustomerDocumentsExporter()
     190        exporter = CustomerDocumentExporter()
    170191        exporter.export_all(self.app, self.outfile)
    171192        result = open(self.outfile, 'rb').read()
     
    185206        # set values we can expect in export file
    186207        self.setup_customer(self.customer)
    187         exporter = CustomerDocumentsExporter()
     208        exporter = CustomerDocumentExporter()
    188209        exporter.export_customer(self.customer, self.outfile)
    189210        result = open(self.outfile, 'rb').read()
Note: See TracChangeset for help on using the changeset viewer.