semvec/pypi-packages huggingface dataset:
django-include-strip-tag 0.1.0
A 'include_strip' templatetag for django to strip trailing and leading spaces/newlines
License: MIT
Keywords: django include templatetag template strip

# django-include-strip-tag

A new "include_strip" template tag for Django

## Introduction

This new templatetag, `include_strip`, works exactly the same as the default `include` template tag provided by Django.

The only difference is that the `strip` method is applied to the result, to remove leading and trailing spaces.

The aim is to remove the unwanted space added in text when including a template that just return some text.


## Installation

`django-include-strip-tag` is available on Pypi:

```
pip install django-include-strip-tag
```

Or you can find it on github: https://github.com/twidi/django-include-strip-tag

When installed, just add `include_strip_tag` to your `INSTALLED_APPS` in the `settings.py` file of your django project.


## Usage

Simply add the tags library in your template, and use `include_strip` instead of `include` when needed:

```django
{% load include_strip %}
Hello {% include_strip "user.html %}, how are you today ?
```

## Why ?

Considering the "user.html" template:

```django
SomeUserName
```

In the previous template (in "Usage"), without this new templatetag, the result would be:

```
Hello SomeUSerName , how are you today ?
```

With `include_strip`, we have:

```
Hello SomeUSerName, how are you today ?
```

Notice the difference between the username and the coma... It's because the newline at the end of the included template is kept when the result is added to the parent template.

So the `include_strip` apply the `strip` method (on the result, which is a string) to remove it.

It can also help if your included template starts with a line dedicated to load tags libraries :

```django
{% load somelibrary %}
add-something-here
```

With the first line having no content rendered, but include a newline, we have this newline in the final template

## License

`django-include-strip-tag` is published under the MIT License (see the LICENSE file)
specloud 0.4.5
install nosetests and plugins to ease bdd unit specs
License: MIT
Keywords: test bdd nosetests spec unit

SpecLoud
========

Use nosetests and plugins to take BDD specifications easier.


Installation
------------

The easiest way to install specloud is using pip and requirements file::

    $ pip install specloud


Usage
=====

Get a python file with BDD-style test names (starting with it, ensure, should, must, spec, example, deve) and add them to the test suite


For example::

    $ cat example.py

    import unittest


    class CalculatorSpec(unittest.TestCase):

        def it_should_sum_integers(self):
            # ...
            pass

        def should_not_divide_by_zero(self):
            # ...
            pass

        def must_accept_floats(self):
            # ...
            pass

        def ensure_it_work_with_fractions(self):
            # ...
            pass

        def test_subtract_positive_from_negative_numbers(self):
            # ...
            pass

        def deve_calcular_raizes_quadradas(self):
            # ...
            pass


The command line tool `specloud` colorizes **green** for tests with no failures and no errors and **red** for tests with failures and/or errors::

    $ specloud example.py

    Calculator spec
    - ensure it work with fractions
    - it should sum integers
    - must accept floats
    - should not divide by zero
    - subtract positive from negative numbers
    - deve calcular raizes quadradas

    ----------------------------------------------------------------------
    Ran 6 tests in 0.003s

    OK


How It Works
------------

SpecLoud is a python package that install `nose`, `pinocchio` and `figleaf` packages, so it can call `nosetests` with `pinocchio` and `figleaf` plugins. `nosetests` is called with some default options to find test methods and `pinocchio` to show pretty and colored messages. `figleaf` is just `pinocchio` dependency.

A call to::

    $ specloud FILE


is the same doing::

    $ nosetests -i '^(it|ensure|must|should|specs?|examples?|deve)' -i '(specs?(.py)?|examples?(.py)?)$' '--with-spec' '--spec-color'

Old Name
--------

The project was born as a proof of concept and I named it firstly `pyunitbdd`. But that's a terrible name. So I renamed the project to `specloud`.