#63 Replacing vote expiration with vote accuarcy
This commit is contained in:
		@@ -124,3 +124,31 @@ class PlaceTestCase(ModelTestCase):
 | 
			
		||||
                self.model.__name__
 | 
			
		||||
            )
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def test_level_calculation(self):
 | 
			
		||||
        place = self.place
 | 
			
		||||
        explorer = place.submitted_by
 | 
			
		||||
 | 
			
		||||
        PlaceVoting.objects.create(
 | 
			
		||||
            submitted_by=explorer,
 | 
			
		||||
            place=place,
 | 
			
		||||
            vote=5,
 | 
			
		||||
            expires_when=timezone.now()+self.delta
 | 
			
		||||
        )
 | 
			
		||||
        PlaceVoting.objects.create(
 | 
			
		||||
            submitted_by=explorer,
 | 
			
		||||
            place=place,
 | 
			
		||||
            vote=2,
 | 
			
		||||
            expires_when=timezone.now()+self.delta
 | 
			
		||||
        )
 | 
			
		||||
        PlaceVoting.objects.create(
 | 
			
		||||
            submitted_by=explorer,
 | 
			
		||||
            place=place,
 | 
			
		||||
            vote=4,
 | 
			
		||||
            expires_when=timezone.now()+self.delta
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        self.assertEqual(
 | 
			
		||||
            4,
 | 
			
		||||
            place.calculate_place_level()
 | 
			
		||||
        )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user