mirror of
https://github.com/kennethreitz/dj-database-url.git
synced 2026-06-05 23:10:17 +00:00
postgres test
This commit is contained in:
+18
-1
@@ -1,17 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import dj_database_url
|
||||
|
||||
|
||||
POSTGIS_URL = 'postgis://uf07k1i6d8ia0v:wegauwhgeuioweg@ec2-107-21-253-135.compute-1.amazonaws.com:5431/d8r82722r2kuvn'
|
||||
|
||||
|
||||
class DatabaseTestSuite(unittest.TestCase):
|
||||
|
||||
def test_truth(self):
|
||||
assert True
|
||||
|
||||
def test_postgres_parsing(self):
|
||||
url = 'postgres://uf07k1i6d8ia0v:wegauwhgeuioweg@ec2-107-21-253-135.compute-1.amazonaws.com:5431/d8r82722r2kuvn'
|
||||
url = dj_database_url.parse(url)
|
||||
|
||||
assert url['ENGINE'] == 'django.db.backends.postgresql_psycopg2'
|
||||
assert url['NAME'] == 'd8r82722r2kuvn'
|
||||
assert url['HOST'] == 'ec2-107-21-253-135.compute-1.amazonaws.com'
|
||||
assert url['USER'] == 'uf07k1i6d8ia0v'
|
||||
assert url['PASSWORD'] == 'wegauwhgeuioweg'
|
||||
assert url['PORT'] == 5431
|
||||
|
||||
|
||||
# unittest.TestCase
|
||||
# postgres://uf07k1i6d8ia0v:wegauwhgeuioweg@ec2-107-21-253-135.compute-1.amazonaws.com:5431/d8r82722r2kuvn
|
||||
#
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user