~schooltool-owners/schooltool/1.5

« back to all changes in this revision

Viewing changes to src/schooltool/export/ftests/sample_data.txt

  • Committer: Gediminas Paulauskas
  • Date: 2011-09-04 17:31:46 UTC
  • Revision ID: menesis@pov.lt-20110904173146-jv6wn0mxzkumvdv9
Fixed XLS import crashes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Test for sample data import
2
2
---------------------------
3
3
 
4
 
Let's import a subset of the sample data:
5
 
 
6
4
    >>> browser = Browser('manager', 'schooltool')
7
5
    >>> browser.getLink('Manage').click()
8
6
    >>> browser.getLink('XLS Import').click()
 
7
 
 
8
Click the submit button without selecting a file:
 
9
 
 
10
    >>> browser.getControl('Submit').click()
 
11
    >>> browser.printQuery("//p[@class='error']")
 
12
    <p class="error">No data provided</p>
 
13
 
 
14
Let's import a subset of the sample data:
 
15
 
9
16
    >>> import pkg_resources
10
17
    >>> browser.getControl('XLS File').add_file(
11
18
    ...     pkg_resources.resource_stream('schooltool.export.ftests', 'test_data.xls'),
13
20
    ...     'sample_data.xls')
14
21
    >>> browser.getControl('Submit').click()
15
22
 
 
23
There should be no errors:
 
24
 
 
25
    >>> browser.printQuery("//p[@class='error']")
 
26
 
16
27
Let's check the data. We have 4 terms:
17
28
 
18
29
    >>> browser.getLink('2006-2008').click()