|
6 | 6 |
|
7 | 7 | from nose.tools import raises
|
8 | 8 | from unittest import TestCase
|
| 9 | +from plotly.tests.utils import PlotlyTestCase |
9 | 10 | import json
|
10 | 11 |
|
11 | 12 | import plotly
|
|
21 | 22 |
|
22 | 23 | PLOTLYJS = plotly.offline.offline.get_plotlyjs()
|
23 | 24 |
|
| 25 | + |
24 | 26 | class PlotlyOfflineTestCase(TestCase):
|
25 | 27 | def setUp(self):
|
26 | 28 | pass
|
@@ -79,11 +81,22 @@ def test_autoresizing(self):
|
79 | 81 | for resize_code_string in resize_code_strings:
|
80 | 82 | self.assertTrue(resize_code_string not in html)
|
81 | 83 |
|
82 |
| - def test_plot_rendered_if_non_plotly_domain(self): |
| 84 | + |
| 85 | +class PlotlyOfflineOtherDomainTestCase(PlotlyTestCase): |
| 86 | + def setUp(self): |
| 87 | + super(PlotlyOfflineOtherDomainTestCase, self).setUp() |
83 | 88 | plotly.tools.set_config_file(plotly_domain='https://stage.plot.ly',
|
84 | 89 | plotly_api_domain='https://api-stage.plot.ly')
|
| 90 | + plotly.plotly.sign_in('PlotlyTestShark', 'kI2H0E7sTZ5RM9yoaK4X') |
85 | 91 |
|
| 92 | + def test_plot_rendered_if_non_plotly_domain(self): |
86 | 93 | html = plotly.offline.plot(fig, output_type='div')
|
| 94 | + |
87 | 95 | # test that 'Export to stage.plot.ly' is in the html
|
88 | 96 | self.assertTrue('Export to stage.plot.ly' in html)
|
89 |
| - self.assertTrue('Export to plot.ly' not in html) |
| 97 | + |
| 98 | + def tearDown(self): |
| 99 | + plotly.tools.set_config_file(plotly_domain='https://plot.ly', |
| 100 | + plotly_api_domain='https://api.plot.ly') |
| 101 | + plotly.plotly.sign_in('PythonTest', '9v9f20pext') |
| 102 | + super(PlotlyOfflineOtherDomainTestCase, self).tearDown() |
0 commit comments