Added example

This commit is contained in:
Tyrel Souza 2015-09-07 14:29:31 -04:00
parent e5eb602ec8
commit 05bb55b46e
2 changed files with 15980 additions and 0 deletions

15971
testing/example-ride.gpx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,11 @@ from django.core.management.base import CommandError
# Create your tests here.
class ImportGPXManagementTest(TestCase):
fixtures = ['tracking_test_fixtures.json',]
def setUp(self):
self.example_ride_file = "testing/example-ride.gpx"
def test_user_does_not_exist(self):
with self.assertRaisesMessage(CommandError, "User THISUSERWONTEXIST does not exist"):
management.call_command('import_gpx', 'THISUSERWONTEXIST', 'foo')
@ -13,3 +18,7 @@ class ImportGPXManagementTest(TestCase):
with self.assertRaisesMessage(CommandError, "/noop/nodir/ is neither an existing file, nor a path."):
management.call_command('import_gpx', 'tyrel', '/noop/nodir/')
def test_import(self):
management.call_command('import_gpx', 'tyrel', 'testing/example-ride.gpx')