Example #1
0
 def test_get_track_passes(self):
     # Arrange
     track = Track.objects.create(name='bogus track', distance=50,
         timeout=100, unit_of_measurement=settings.METRIC)
     # Act
     result = api_track.get_track(track.name)
     # Assert
     self.assertTrue(result.ok)
     self.assertEqual('get_track', result.call)
     self.assertEqual(track, result.data)
Example #2
0
 def test_get_track_fails_when_rider_not_found(self):
     # Arrange
     track = Track.objects.create(name='bogus track', distance=50,
         timeout=100, unit_of_measurement=settings.METRIC)
     # Act
     result = api_track.get_track('nope')
     # Assert
     self.assertFalse(result.ok)
     self.assertEqual('get_track', result.call)
     error = 'Track not found' # TODO: i18n
     self.assertEqual(error, result.data)
Example #3
0
 def test_get_track_passes(self):
     # Arrange
     track = Track.objects.create(name='bogus track',
                                  distance=50,
                                  timeout=100,
                                  unit_of_measurement=settings.METRIC)
     # Act
     result = api_track.get_track(track.name)
     # Assert
     self.assertTrue(result.ok)
     self.assertEqual('get_track', result.call)
     self.assertEqual(track, result.data)
Example #4
0
 def test_get_track_fails_when_rider_not_found(self):
     # Arrange
     track = Track.objects.create(name='bogus track',
                                  distance=50,
                                  timeout=100,
                                  unit_of_measurement=settings.METRIC)
     # Act
     result = api_track.get_track('nope')
     # Assert
     self.assertFalse(result.ok)
     self.assertEqual('get_track', result.call)
     error = 'Track not found'  # TODO: i18n
     self.assertEqual(error, result.data)