View Issue Details

IDProjectCategoryView StatusLast Update
0005023Talerobsolete componentpublic2018-04-15 20:34
ReporterMarcello Stanisci Assigned ToMarcello Stanisci  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Product Versiongit (master) 
Target Version0.5Fixed in Version0.5 
Summary0005023: Avoid django's TestCase class
DescriptionBank's testcases should import python's unittest module and run test against
it, rather than import django's TestCase class. This way it's easier to catch
errors before tests are run.

For example, errors like django.db.utils.OperationalError are uncatchable by django's
TestCase class. If instead we bypass all the django initialization logic and use python's
unittest directly, we will have more freedom to check if the environment is OK and return
accordingly.
TagsNo tags attached.

Activities

Marcello Stanisci

2017-05-23 21:44

reporter   ~0012150

WARNING: this way we lose the (HTTP) Client class exported by django.

Florian Dold

2017-05-23 21:51

manager   ~0012151

In what sense? Why can't we still use the HTTP class?

Florian Dold

2017-05-23 21:55

manager   ~0012152

FYI, you can see the implementation of the Django TestCase here: https://github.com/django/django/blob/538bf43458a147b7edeb7118c9f325c3f59ff6fb/django/test/testcases.py#L953

If necessary, we have to do our own subclass.

Marcello Stanisci

2017-05-23 22:26

reporter   ~0012153

@12151: I thought that we wanted to fire every testcase class coming from Django,
but yes, there is no strong reason to not mix things when it's necessary.

Marcello Stanisci

2017-12-23 12:56

reporter   ~0012703

The TestCase class from Django turned to be very useful, especially thanks to
the 'assertJSONEqual' method and other helpers it has over the "bare" Python's
unittest. Besides, now (88bef48) 'make check' does test the launcher against a
 database which is not found, so this bug is not that worth working on IMO.

Issue History

Date Modified Username Field Change
2017-05-22 16:38 Marcello Stanisci New Issue
2017-05-22 16:38 Marcello Stanisci Status new => assigned
2017-05-22 16:38 Marcello Stanisci Assigned To => Marcello Stanisci
2017-05-23 21:44 Marcello Stanisci Note Added: 0012150
2017-05-23 21:51 Florian Dold Note Added: 0012151
2017-05-23 21:55 Florian Dold Note Added: 0012152
2017-05-23 22:26 Marcello Stanisci Note Added: 0012153
2017-12-14 15:55 Christian Grothoff Product Version => git (master)
2017-12-14 15:55 Christian Grothoff Target Version => 0.6
2017-12-23 12:56 Marcello Stanisci Status assigned => resolved
2017-12-23 12:56 Marcello Stanisci Resolution open => no change required
2017-12-23 12:56 Marcello Stanisci Note Added: 0012703
2017-12-28 17:28 Christian Grothoff Fixed in Version => 0.5
2017-12-28 17:28 Christian Grothoff Target Version 0.6 => 0.5
2018-04-15 20:34 Christian Grothoff Status resolved => closed
2022-08-23 20:26 Christian Grothoff Category bank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 01:23 Christian Grothoff Category py bank (demonstrator, obsolete) => obsolete componet
2023-12-11 20:08 Florian Dold Category obsolete componet => obsolete component