Commits

Luke Plant committed df3c32a

Added test for Ajax 'places_json' view

  • Participants
  • Parent commits fca5867
  • Branches bookings

Comments (0)

Files changed (1)

cciw/bookings/tests.py

         acc.receive_payment((p1 + p2) - p)
         self.assertTrue(acc.bookings.filter(price_type=PRICE_FULL)[0].booking_expires is None)
 
+
+class TestAjaxViews(CreatePlaceMixin, TestCase):
+    # Basic tests to ensure that the views that serve AJAX return something
+    # sensible
+
+    fixtures = ['basic.json']
+
+    def test_places_json(self):
+        self.login()
+        self.create_place()
+        resp = self.client.get(reverse('cciw.bookings.views.places_json'))
+        json = simplejson.loads(resp.content)
+        self.assertEqual(json['places'][0]['name'], self.place_details['name'])