django - ModuleNotFoundError:没有名为“上下文”的模块
问题描述
尝试运行 pyVows 测试时出现以下错误:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\unittest\loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "C:\Program Files\Python38\lib\unittest\loader.py", line 377, in _get_module_from_name
__import__(name)
File "D:\Programmierung\Python-Projekte\JourneyMap\JourneyMap\tests.py", line 2, in <module>
from django_pyvows.context import DjangoHTTPContext
File "C:\Users\malo0\AppData\Roaming\Python\Python38\site-packages\django_pyvows\__init__.py", line 11, in <module>
from context import DjangoContext, DjangoHTTPContext
ModuleNotFoundError: No module named 'context'
我安装了pyVows and django-pyvows
我错过了什么吗?我没有找到有用的文档
要求编辑:
from pyvows import Vows, expect
from django_pyvows.context import DjangoHTTPContext
# Create your tests here.
@Vows.batch
class LanguageTest(Vows.Context):
class LanguageSelectIntegrationTest(DjangoHTTPContext):
def topic(self):
return self.get('/')
def test(self, topic):
# Test will be here
pass
解决方案
推荐阅读
- c++ - 为什么 int b; 在外壳/终端中有 16 个值?
- php - 如何使用变形一对多文件处理外键
- powerbi - Power BI - 你看不到此报表的内容,因为你没有对基础数据集的权限
- image - Xamarin Forms:如何为图像添加单击和双击?
- javascript - Highcharts Gantt - 在 yAxis 上设置最大高度和滚动条
- jira - Eazy Bi - 单元格格式计算 - 平均值和百分比
- python - 除非暂停,否则循环中设置的全局变量不会更新
- python-3.x - Python Pandas SQL NaN 值问题
- c# - 如何在类库中使用依赖注入?
- python - PyQt QImage不能复制,崩溃没有错误代码