2013-10-24 00:27:52 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
import ujson
|
|
|
|
|
|
|
|
from django.test import TestCase
|
|
|
|
|
|
|
|
class EndpointDiscoveryTest(TestCase):
|
|
|
|
def test_staging_user(self):
|
2016-07-30 00:39:56 +02:00
|
|
|
# type: () -> None
|
2013-10-24 00:27:52 +02:00
|
|
|
response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@zulip.com"})
|
|
|
|
data = ujson.loads(response.content)
|
2015-02-06 07:14:14 +01:00
|
|
|
self.assertEqual(data["result"]["base_site_url"], "https://zulip.com/")
|
|
|
|
self.assertEqual(data["result"]["base_api_url"], "https://zulip.com/api/")
|
2013-10-24 00:27:52 +02:00
|
|
|
|
|
|
|
def test_prod_user(self):
|
2016-07-30 00:39:56 +02:00
|
|
|
# type: () -> None
|
2013-10-24 00:27:52 +02:00
|
|
|
response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@mit.edu"})
|
|
|
|
data = ujson.loads(response.content)
|
|
|
|
self.assertEqual(data["result"]["base_site_url"], "https://zulip.com/")
|
|
|
|
self.assertEqual(data["result"]["base_api_url"], "https://api.zulip.com/")
|
|
|
|
|