Ejemplo n.º 1
0
 def test_remove_rider_fails_when_rider_not_found(self):
     # Arrange & Act
     result = api_rider.remove_rider('bogus rider')
     # Assert
     self.assertFalse(result.ok)
     self.assertEqual('remove_rider', result.call)
     error = 'Rider not found' # TODO: i18n
     self.assertEqual(error, result.data)
Ejemplo n.º 2
0
 def test_remove_rider_fails_when_rider_not_found(self):
     # Arrange & Act
     result = api_rider.remove_rider('bogus rider')
     # Assert
     self.assertFalse(result.ok)
     self.assertEqual('remove_rider', result.call)
     error = 'Rider not found'  # TODO: i18n
     self.assertEqual(error, result.data)
Ejemplo n.º 3
0
 def test_remove_rider_passes(self):
     # Arrange
     name = 'bogus rider'
     rider = Rider.objects.create(name=name)
     # Act
     result = api_rider.remove_rider(name)
     # Assert
     self.assertFalse(Rider.objects.filter(name=name).exists())
     self.assertTrue(result.ok)
     self.assertEqual('remove_rider', result.call)
     self.assertEqual(name, result.data)
Ejemplo n.º 4
0
 def test_remove_rider_passes(self):
     # Arrange
     name = 'bogus rider'
     rider = Rider.objects.create(name=name)
     # Act
     result = api_rider.remove_rider(name)
     # Assert
     self.assertFalse(Rider.objects.filter(name=name).exists())
     self.assertTrue(result.ok)
     self.assertEqual('remove_rider', result.call)
     self.assertEqual(name, result.data)