@@ -0,0 +1,1833 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0Afrom __future__ import division%0A%0Afrom django.contrib.gis.geos import LineString, MultiLineString%0Afrom django.test import TestCase%0A%0Afrom apps.core.models import User%0Afrom apps.core.test_utils import make_request%0Afrom apps.survey.models import Blockface, Survey%0A%0Afrom nyc_trees.context_processors import tiler_cache_busters%0A%0A%0Aclass CacheBustersContextProcessorTest(TestCase):%0A    def setUp(self):%0A        self.user = User.objects.create(%0A            username='pat',%0A            email='pat@rat.com'%0A        )%0A        self.blockface = Blockface.objects.create(%0A            geom=MultiLineString(LineString(((0, 0), (1, 1))))%0A        )%0A        self.survey = Survey.objects.create(user=self.user,%0A                                            blockface=self.blockface)%0A%0A    def test_full_request(self):%0A        context = tiler_cache_busters(make_request())%0A        self.assertTrue('cache_buster' in context,%0A                        'Expected the context to have a %22cache_buster%22 key.')%0A        self.assertTrue('progress' in context%5B'cache_buster'%5D,%0A                        'Expected the %22cache_buster%22 dict to have a '%0A                        '%22progress%22 key.')%0A        self.assertTrue(context%5B'cache_buster'%5D%5B'progress'%5D,%0A                        'Expected the %22progress%22 key of the %22cache_buster%22 '%0A                        'dict to be truthy.')%0A%0A    def test_ajax_request(self):%0A        context = tiler_cache_busters(make_request(%0A            HTTP_X_REQUESTED_WITH='XMLHttpRequest'))%0A        self.assertFalse('cache_buster' in context,%0A                         'Expected the context to not have a %22cache_buster%22 '%0A                         'key when the HTTP_X_REQUESTED_WITH header is set '%0A                         'to %22XMLHttpRequest%22')%0A

add tests