Skip to content

Commit

Permalink
multiple days set as default
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Whiteland committed May 14, 2011
1 parent 6961115 commit f085554
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions pylib/djangoproj/binalerts/tests.py
Expand Up @@ -260,18 +260,25 @@ def test_load_data_from_pdf_xml(self):
response = self.c.post('/', { 'query': 'Barnet Lane' })
self.assertContains(response, "No street found with that name.")

# need BINS_ALLOW_MULTIPLE_COLLECTIONS_PER_WEEK set to false to test this TODO
# multiple days of week e.g Tuesday/Thursday are ignored for now
response = self.c.post('/', { 'query': 'Athenaeum Road' })
self.assertContains(response, "No street found with that name.")

# split lines, e.g. Barnet (Arkley Park\nMobile Homes) are ignored for now
response = self.c.post('/', { 'query': 'Athenaeum Road' })
self.assertContains(response, "No street found with that name.")
# response = self.c.post('/', { 'query': 'Athenaeum Road' })
# self.assertContains(response, "No street found with that name.")

# they are green waste
# they are green/garden waste (the default for xml import)
response = self.c.get('/street/juniper_close_en5')
self.assertContains(response, 'Green Garden')

def test_load_data_from_pdf_xml_with_multiple_days(self):
garden_sample_file = os.path.join(os.path.dirname(binalerts.__file__), 'fixtures/garden_sample_pdf.xml')
DataImport.load_from_pdf_xml(garden_sample_file)

# multiple days of week e.g Tuesday/Thursday are handled OK
response = self.c.get('/street/athenaeum_road_n20')
#import pdb; pdb.set_trace()
self.assertContains(response, "Kitchen Waste</strong> collection days are <strong>Tuesday &amp; Thursday")


def test_load_data_from_csv(self):
# short_sample.csv is the first few lines from a Barnet spreadsheet, exported to CSV
domestic_sample_file = os.path.join(os.path.dirname(binalerts.__file__), 'fixtures/short_sample.csv')
Expand All @@ -287,7 +294,7 @@ def test_load_data_from_csv(self):
response = self.c.get('/street/juniper_close')
self.assertContains(response, 'Tuesday')

# they are domestic waste
# they are domestic waste (the default for csv import)
response = self.c.get('/street/amber_grove')
self.assertContains(response, 'Domestic')

Expand Down
4 changes: 2 additions & 2 deletions pylib/djangoproj/settings.py
Expand Up @@ -50,9 +50,9 @@
DATABASE_PORT = config.get('BINS_DB_PORT')

# True if the *same type of collection* can occur at a given address more than once a week
# (the default, False, is common: e.g., recycling is only collected once a week)
# (False may be common: e.g., recycling is only collected once a week)
# If false, it means if the a new collection day is read from the import, the old one will be deleted
BINS_ALLOW_MULTIPLE_COLLECTIONS_PER_WEEK = config.get('BINS_ALLOW_MULTIPLE_COLLECTIONS_PER_WEEK', False)
BINS_ALLOW_MULTIPLE_COLLECTIONS_PER_WEEK = config.get('BINS_ALLOW_MULTIPLE_COLLECTIONS_PER_WEEK', True)

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
Expand Down

0 comments on commit f085554

Please sign in to comment.