forked from frappe/frappe
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[geo ip] determine country using geoip; added country info in session…
… and cookies
- Loading branch information
1 parent
72a4b83
commit 2078d52
Showing
4 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import webnotes | ||
import unittest | ||
|
||
class TestGeoIP(unittest.TestCase): | ||
def test_geo_ip(self): | ||
from webnotes.sessions import get_geo_ip_country | ||
self.assertEquals(get_geo_ip_country("5.10.83.223"), "India") | ||
self.assertEquals(get_geo_ip_country("223.29.223.255"), "India") | ||
self.assertEquals(get_geo_ip_country("4.18.32.80"), "United States") | ||
self.assertEquals(get_geo_ip_country("217.194.147.25"), "United States") |