diff --git a/rattail/tests/commands/test_core.py b/rattail/tests/commands/test_core.py index 1f4685e796a0566ca3230ef51ca0a8a2661351e2..05a5b1901d952dc1d7785b21c2105a6201bb2306 100644 --- a/rattail/tests/commands/test_core.py +++ b/rattail/tests/commands/test_core.py @@ -161,44 +161,6 @@ class TestSubcommand(TestCase): self.assertRaises(NotImplementedError, subcommand.run, args) -class TestDump(DataTestCase): - - def setUp(self): - super(TestDump, self).setUp() - self.session.add(model.Product(upc='074305001321')) - self.session.add(model.Product(upc='074305001161')) - self.session.commit() - - def test_unknown_model_cannot_be_dumped(self): - tmp = TempIO() - stderr_path = tmp.putfile('stderr.txt', '') - self.assertRaises(SystemExit, core.main, '--no-init', '--stderr', stderr_path, 'dump', 'NoSuchModel') - with open(stderr_path) as f: - self.assertEqual(f.read(), "Unknown model: NoSuchModel\n") - - def test_dump_goes_to_stdout_by_default(self): - tmp = TempIO() - stdout_path = tmp.putfile('stdout.txt', '') - core.main('--no-init', '--stdout', stdout_path, 'dump', 'Product') - with open(stdout_path, 'rb') as csv_file: - reader = csv.DictReader(csv_file) - upcs = [row['upc'] for row in reader] - self.assertEqual(len(upcs), 2) - self.assertTrue('00074305001321' in upcs) - self.assertTrue('00074305001161' in upcs) - - def test_dump_goes_to_file_if_so_invoked(self): - tmp = TempIO() - output_path = tmp.putfile('output.txt', '') - core.main('--no-init', 'dump', 'Product', '--output', output_path) - with open(output_path, 'rb') as csv_file: - reader = csv.DictReader(csv_file) - upcs = [row['upc'] for row in reader] - self.assertEqual(len(upcs), 2) - self.assertTrue('00074305001321' in upcs) - self.assertTrue('00074305001161' in upcs) - - # TODO: more broken tests..ugh. these aren't very good or else i might bother # fixing them... # class TestFileMonitor(TestCase): diff --git a/rattail/tests/db/model/test_customers.py b/rattail/tests/db/model/test_customers.py index 5b4b62f4522c8e80fc3d453318e9cd88a823cf5b..60433ce5d112c6c7a58731382bf24cd3dc9b0943 100644 --- a/rattail/tests/db/model/test_customers.py +++ b/rattail/tests/db/model/test_customers.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8; -*- from __future__ import unicode_literals, absolute_import @@ -8,18 +8,6 @@ from rattail.tests import DataTestCase class TestCustomer(DataTestCase): - def test_unicode(self): - customer = model.Customer() - self.assertEqual(unicode(customer), "") - - customer = model.Customer(name=b"Fred Flintstone") - self.assertEqual(unicode(customer), "Fred Flintstone") - - customer = model.Customer(people=[model.Person(first_name="Fred", last_name="Flintstone")]) - self.session.add(customer) - self.session.flush() - self.assertEqual(unicode(customer), "Fred Flintstone") - # TODO: this is duplicated in TestPerson def test_add_email_address(self): customer = model.Customer() @@ -51,13 +39,3 @@ class TestCustomer(DataTestCase): self.assertEqual(len(customer.phones), 1) phone = customer.phones[0] self.assertEqual(phone.type, 'Work') - - -class TestCustomerGroup(DataTestCase): - - def test_unicode(self): - group = model.CustomerGroup() - self.assertEqual(unicode(group), "") - - group = model.CustomerGroup(name=b"Loyal Shoppers") - self.assertEqual(unicode(group), "Loyal Shoppers")