Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fdw-forks
django-database-files
Commits
3a56c023
Commit
3a56c023
authored
Apr 15, 2012
by
chris
Browse files
Fixed unittest command.
parent
35885cfc
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
3a56c023
...
@@ -16,11 +16,15 @@ Requires:
...
@@ -16,11 +16,15 @@ Requires:
Installation
Installation
------------
------------
$
sudo python setup.py install
sudo python setup.py install
Or via pip with:
Or via pip with:
$ sudo pip install https://github.com/chrisspen/django-database-files/zipball/master
sudo pip install https://github.com/chrisspen/django-database-files/zipball/master
You can run unittests with:
python setup.py test
Usage
Usage
-----
-----
...
@@ -53,8 +57,3 @@ To delete all files in the database and file system not referenced by any model
...
@@ -53,8 +57,3 @@ To delete all files in the database and file system not referenced by any model
fields, run:
fields, run:
$ python manage.py database_files_cleanup
$ python manage.py database_files_cleanup
Test suite
----------
$ ./run_tests.sh
database_files/__init__.py
View file @
3a56c023
VERSION
=
(
0
,
1
,
3
)
VERSION
=
(
0
,
1
,
4
)
__version__
=
'.'
.
join
(
map
(
str
,
VERSION
))
__version__
=
'.'
.
join
(
map
(
str
,
VERSION
))
\ No newline at end of file
database_files/tests/.gitignore
0 → 100644
View file @
3a56c023
/media
database_files/tests/tests.py
View file @
3a56c023
...
@@ -15,7 +15,10 @@ class DatabaseFilesTestCase(TestCase):
...
@@ -15,7 +15,10 @@ class DatabaseFilesTestCase(TestCase):
# Create default thing storing reference to file
# Create default thing storing reference to file
# in the local media directory.
# in the local media directory.
fqfn
=
os
.
path
.
join
(
DIR
,
'media/i/special/test.txt'
)
media_dir
=
os
.
path
.
join
(
DIR
,
'media/i/special'
)
if
not
os
.
path
.
isdir
(
media_dir
):
os
.
makedirs
(
media_dir
)
fqfn
=
os
.
path
.
join
(
media_dir
,
'test.txt'
)
open
(
fqfn
,
'w'
).
write
(
'hello there'
)
open
(
fqfn
,
'w'
).
write
(
'hello there'
)
o
=
Thing
()
o
=
Thing
()
o
.
upload
=
'i/special/test.txt'
o
.
upload
=
'i/special/test.txt'
...
...
run_tests.sh
deleted
100755 → 0
View file @
35885cfc
#!/bin/bash
PYTHONPATH
=
.
DJANGO_SETTINGS_MODULE
=
"database_files.tests.settings"
django-admin.py
test
tests
\ No newline at end of file
setup.py
View file @
3a56c023
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
distutils.core
import
setup
import
os
from
distutils.core
import
setup
,
Command
import
database_files
import
database_files
class
TestCommand
(
Command
):
description
=
"Runs unittests."
user_options
=
[]
def
initialize_options
(
self
):
pass
def
finalize_options
(
self
):
pass
def
run
(
self
):
os
.
system
(
'django-admin.py test --pythonpath=. --settings=database_files.tests.settings tests'
)
setup
(
setup
(
name
=
'django-database-files'
,
name
=
'django-database-files'
,
version
=
database_files
.
__version__
,
version
=
database_files
.
__version__
,
...
@@ -23,4 +35,7 @@ setup(
...
@@ -23,4 +35,7 @@ setup(
'Operating System :: OS Independent'
,
'Operating System :: OS Independent'
,
'Programming Language :: Python'
,
'Programming Language :: Python'
,
],
],
cmdclass
=
{
'test'
:
TestCommand
,
},
)
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment