Exemple #1
0
    def test_model_field(self):
        user = self._create_user('buddy', 'password')

        img = ImageRequest()
        img.user = user
        img.location = "Downtown Tulsa"
        img.description = "Williams Tower"
        img.expiration = now()
        img.latitude = 35.987628
        img.longitude = -96.114063
        
        img.save()

        self.assertEqual(img.id, ImageRequest.objects.get(location__exact="Downtown Tulsa").id)
Exemple #2
0
 def _create_image_request(self):
     user = self._create_user('joe', 'password')
     ir = ImageRequest(location="tulsa", description="downtown", user=user)
     ir.save()
     return ir