Skip to content

Commit

Permalink
Fix broken test (GeoNode#10266) (GeoNode#10267)
Browse files Browse the repository at this point in the history
* Fix broken test build

* Fix broken test build

Co-authored-by: mattiagiupponi <[email protected]>
  • Loading branch information
2 people authored and ridoo committed Sep 18, 2023
1 parent 4c1eb93 commit fad9b26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions geonode/security/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,15 @@ def test_admin_whitelisted_access_middleware(self):
middleware.process_request(request)
self.assertTrue(request.user.is_superuser)

# Test valid IP in second element
with self.settings(ADMIN_IP_WHITELIST=['88.88.88.88', '127.0.0.1']):
request = HttpRequest()
request.user = admin
request.path = reverse('home')
request.META['REMOTE_ADDR'] = '127.0.0.1'
middleware.process_request(request)
self.assertTrue(request.user.is_superuser)


class SecurityRulesTests(TestCase):
"""
Expand Down

0 comments on commit fad9b26

Please sign in to comment.