正如在视觉应用程序中有时常见的那样,我有一些代码,其中数据在可视组件(TTreeView组件)中维护.我正在重构代码并为逻辑创建单元测试.
我的测试项目中唯一的可视化形式是GUITestRunner.将来我计划在持续集成服务器下将测试作为控制台应用程序运行,所以我没有任何形式.
当我尝试创建没有父级的TTreeView小部件并使用它时,我收到以下错误:
Control '' has no parent window
Run Code Online (Sandbox Code Playgroud)
在我的测试套件SetUp方法上创建小部件并在TearDown中销毁它的最佳方法是什么?是否可以在控制台应用程序中使用可视窗口小部件?我不需要显示它,甚至不需要处理事件.我只需要创建子节点并访问数据.
我设法让它与一个丑陋的黑客一起工作,但我想知道是否有一些标准的做法.
当然,在我阳光明媚和遥远的未来,我将重构这个2.1万行格式的代码,我的所有数据都将处于漂亮的数据结构中,并且这些测试不是必需的,但现在我需要它.
我正在使用Delphi的fastMM内存管理器,当我尝试使用完整的调试模式时,我失败了.
编译时出现以下错误:
FastMM\FastMM4.pas(6872) Error: Undeclared identifier: 'RegisterExpectedMemoryLeak'
FastMM\FastMM4.pas(6948) Error: Undeclared identifier: 'UnregisterExpectedMemoryLeak'
FastMM\FastMM4.pas(9269)
import_test.dpr(24) Fatal: Could not compile used unit 'FastMM\FastMM4.pas'
Run Code Online (Sandbox Code Playgroud)
.inc文件告诉加载完整的调试dll.我已经到处复制了FastMM_FullDebugMode.dll文件.看起来我应该在我的项目中包含一些东西.
我可能错过了一些非常明显的东西.
Delphi版本是7.
当我运行 jar 文件时,出现以下错误:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Run Code Online (Sandbox Code Playgroud)
问题是我没有使用 slf4j,我使用的是 log4j2。它由依赖项使用。Maven 正确地将 org.slf4j:slf4j-api 包含为我正在使用的库的传递依赖项。
我该如何摆脱这个警告?我什至不想记录这种依赖关系的问题。
我已经安装了django-allauth,之后这是我的settings.py
Django_apps = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
Third_party_apps = (
'avatar',
'allauth',
'allauth.account',
'allauth.socialaccount',
'bootstrapform',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.twitter',
)
My_apps = ()
INSTALLED_APPS = Django_apps + Third_party_apps + My_apps
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
"django.core.context_processors.request",
"allauth.account.context_processors.account",
"allauth.socialaccount.context_processors.socialaccount",
)
AUTHENTICATION_BACKENDS = (
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
)
ACCOUNT_ADAPTER ="allauth.account.adapter.DefaultAccountAdapter"
ACCOUNT_AUTHENTICATION_METHOD = "username_email"
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = "optional"
ACCOUNT_USERNAME_MIN_LENGTH = 3
Run Code Online (Sandbox Code Playgroud)
我相信我也正确设置了我的urls.py. 而且我还有两个来自django admin的社交应用程序,带有正确的twitter和github api密钥和秘密.
但问题是每当我点击通过Twitter登录时它会向我显示正确的twitter身份验证页面,在我授权应用程序后它会给我这个错误..
<allauth.socialaccount.models.SocialLogin …Run Code Online (Sandbox Code Playgroud)