'Test formation of REST call to geoserver\'s geogig API'

def test_payload_creation(self):

    author_name = 'test'
    author_email = 'testuser@geonode.org'
    settings.OGC_SERVER['default']['PG_GEOGIG'] = False
    fb_message = {'authorName': author_name, 'authorEmail': author_email, 'parentDirectory': settings.OGC_SERVER['default']['GEOGIG_DATASTORE_DIR']}
    fb_payload = make_geogig_rest_payload(author_name, author_email)
    self.assertDictEqual(fb_message, fb_payload)
    self.assertEquals(json.dumps(fb_message, sort_keys=True), json.dumps(fb_payload, sort_keys=True))
    settings.OGC_SERVER['default']['PG_GEOGIG'] = True
    settings.DATABASES['test-pg'] = {'HOST': 'localhost', 'PORT': '5432', 'NAME': 'repos', 'SCHEMA': 'public', 'USER': 'geogig', 'PASSWORD': 'geogig'}
    settings.OGC_SERVER['default']['DATASTORE'] = 'test-pg'
    pg_message = {'authorName': author_name, 'authorEmail': author_email, 'dbHost': settings.DATABASES['test-pg']['HOST'], 'dbPort': settings.DATABASES['test-pg']['PORT'], 'dbName': settings.DATABASES['test-pg']['NAME'], 'dbSchema': settings.DATABASES['test-pg']['SCHEMA'], 'dbUser': settings.DATABASES['test-pg']['USER'], 'dbPassword': settings.DATABASES['test-pg']['PASSWORD']}
    pg_payload = make_geogig_rest_payload(author_name, author_email)
    self.assertDictEqual(pg_message, pg_payload)
    self.assertEquals(json.dumps(pg_message, sort_keys=True), json.dumps(pg_payload, sort_keys=True))
