github 上的源代码中的测试目录意味着什么?
What does the test directories implies in a source code on github?
当您浏览 github 中的一些源代码时,例如 pinax-notification、elasticsearch-dsl 等的源代码,您通常会看到一个名为 'Test' 的文件夹。这个文件夹的作用是什么?它是如何在您自己的代码中使用源代码及其功能的示例还是什么?
例如,我在 pinax-notification 存储库中看到一个 'test' 文件夹,这是否提供了有关如何在我的代码中使用它的示例?
另外,如果没有,请有人与我分享一个关于如何使用 pinax-notification 发送电子邮件通知并通过 django 模板向用户显示通知的示例?
您引用的文件夹包含测试(希望)证明代码的所有部分都按预期工作。所有 Pinax 应用程序都使用名为 "tests" 的文件夹。
这是 pinax-notifications 测试文件夹内容:
测试有多种用途。除了证明代码意图外,它们还可以显示应用程序的使用方式。在 pinax-notifications 的情况下,测试确保各种模型方法和视图按预期运行。但是,这些测试并未显示如何实现您的目标。
Cloudspotting2 demonstration project. In particular please reference receivers.py invocations of "send()" for sending notifications. As for displaying notification to users through Django templates, please see any of the three notifications templates in Cloudspotting2 such as invite_accepted/full.txt.
中阐明了 Pinax 通知的使用
最后,pinax-notifications 文档在此处包含有关使用的有用指南 https://github.com/pinax/pinax-notifications#usage。
当您浏览 github 中的一些源代码时,例如 pinax-notification、elasticsearch-dsl 等的源代码,您通常会看到一个名为 'Test' 的文件夹。这个文件夹的作用是什么?它是如何在您自己的代码中使用源代码及其功能的示例还是什么?
例如,我在 pinax-notification 存储库中看到一个 'test' 文件夹,这是否提供了有关如何在我的代码中使用它的示例? 另外,如果没有,请有人与我分享一个关于如何使用 pinax-notification 发送电子邮件通知并通过 django 模板向用户显示通知的示例?
您引用的文件夹包含测试(希望)证明代码的所有部分都按预期工作。所有 Pinax 应用程序都使用名为 "tests" 的文件夹。 这是 pinax-notifications 测试文件夹内容:
测试有多种用途。除了证明代码意图外,它们还可以显示应用程序的使用方式。在 pinax-notifications 的情况下,测试确保各种模型方法和视图按预期运行。但是,这些测试并未显示如何实现您的目标。
Cloudspotting2 demonstration project. In particular please reference receivers.py invocations of "send()" for sending notifications. As for displaying notification to users through Django templates, please see any of the three notifications templates in Cloudspotting2 such as invite_accepted/full.txt.
中阐明了 Pinax 通知的使用最后,pinax-notifications 文档在此处包含有关使用的有用指南 https://github.com/pinax/pinax-notifications#usage。